Sha256: cc0bdf9c9728bfeadb6fe776d0e82c9c295eccfed5b5594942c6b6aeaf3fddf3

Contents?: true

Size: 1.81 KB

Versions: 6

Compression:

Stored size: 1.81 KB

Contents

module Dry
  module System
    # Error raised when the container tries to load a component with missing
    # file
    #
    # @api public
    FileNotFoundError = Class.new(StandardError) do
      def initialize(component)
        super("could not resolve require file for #{component.identifier}")
      end
    end

    # Error raised when booter file do not match with register component
    #
    # @api public
    ComponentFileMismatchError = Class.new(StandardError) do
      def initialize(component)
        super("Boot file for component #{component.identifier.inspect} not found. Container boot files under #{component.boot_path}: #{component.container_boot_files.inspect}")
      end
    end

    # Error raised when a resolved component couldn't be found
    #
    # @api public
    ComponentLoadError = Class.new(StandardError) do
      def initialize(component)
        super("could not load component #{component.inspect}")
      end
    end

    # Error raised when resolved component couldn't be loaded
    #
    # @api public
    InvalidComponentError = Class.new(ArgumentError) do
      def initialize(name, reason = nil)
        super(
          "Tried to create an invalid #{name.inspect} component - #{reason}"
        )
      end
    end

    # Error raised when component's identifier is not valid
    #
    # @api public
    InvalidComponentIdentifierError = Class.new(ArgumentError) do
      def initialize(name)
        super(
          "component identifier +#{name}+ is invalid or boot file is missing"
        )
      end
    end

    # Error raised when component's identifier for booting is not a symbol
    #
    # @api public
    InvalidComponentIdentifierTypeError = Class.new(ArgumentError) do
      def initialize(name)
        super("component identifier #{name.inspect} must be a symbol")
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dry-system-0.10.0 lib/dry/system/errors.rb
dry-system-0.9.2 lib/dry/system/errors.rb
dry-system-0.9.1 lib/dry/system/errors.rb
dry-system-0.9.0 lib/dry/system/errors.rb
dry-system-0.8.1 lib/dry/system/errors.rb
dry-system-0.8.0 lib/dry/system/errors.rb