Sha256: 5225ddf86a265e8c607aaf7f4b24332e5e80236cea8f1f632175ca0f0cd7a00e

Contents?: true

Size: 1.17 KB

Versions: 4

Compression:

Stored size: 1.17 KB

Contents

# Constants and errors common in the whole library
module ROM
  AdapterLoadError = Class.new(StandardError)

  class AdapterNotPresentError < StandardError
    def initialize(adapter, component)
      super(
        "Failed to find #{component} class for #{adapter} adapter. " \
        "Make sure ROM setup was started and the adapter identifier is correct."
      )
    end
  end

  EnvAlreadyFinalizedError = Class.new(StandardError)
  RelationAlreadyDefinedError = Class.new(StandardError)
  NoRelationError = Class.new(StandardError)
  CommandError = Class.new(StandardError)
  TupleCountMismatchError = Class.new(CommandError)
  MapperMissingError = Class.new(StandardError)
  UnknownPluginError = Class.new(StandardError)
  UnsupportedRelationError = Class.new(StandardError)

  InvalidOptionValueError = Class.new(StandardError)
  InvalidOptionKeyError = Class.new(StandardError)

  class CommandFailure < StandardError
    attr_reader :command
    attr_reader :original_error

    def initialize(command, err)
      super("command: #{command.inspect}; original message: #{err.message}")
      @command = command
      @original_error = err
      set_backtrace(err.backtrace)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rom-0.9.1 lib/rom/constants.rb
rom-0.9.0 lib/rom/constants.rb
rom-0.9.0.rc1 lib/rom/constants.rb
rom-0.9.0.beta1 lib/rom/constants.rb