Sha256: 6602c91ea0a091f1b362b5502f6514066833a8f30a6d3fbbc9c1dde61c3d287b

Contents?: true

Size: 1 KB

Versions: 15

Compression:

Stored size: 1 KB

Contents

require 'rom/sql/error'

module ROM
  module SQL
    MissingConfigurationError = Class.new(StandardError)
    NoAssociationError        = Class.new(StandardError)
    DatabaseError             = Class.new(Error)
    ConstraintError           = Class.new(Error)
    NotNullConstraintError    = Class.new(ConstraintError)
    UniqueConstraintError     = Class.new(ConstraintError)
    ForeignKeyConstraintError = Class.new(ConstraintError)
    CheckConstraintError      = Class.new(ConstraintError)
    UnknownDBTypeError        = Class.new(StandardError)
    MissingPrimaryKeyError    = Class.new(StandardError)

    ERROR_MAP = {
      Sequel::DatabaseError => DatabaseError,
      Sequel::ConstraintViolation => ConstraintError,
      Sequel::NotNullConstraintViolation => NotNullConstraintError,
      Sequel::UniqueConstraintViolation => UniqueConstraintError,
      Sequel::ForeignKeyConstraintViolation => ForeignKeyConstraintError,
      Sequel::CheckConstraintViolation => CheckConstraintError
    }.freeze
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rom-sql-1.3.5 lib/rom/sql/errors.rb
rom-sql-1.3.4 lib/rom/sql/errors.rb
rom-sql-1.3.3 lib/rom/sql/errors.rb
rom-sql-1.3.2 lib/rom/sql/errors.rb
rom-sql-1.3.1 lib/rom/sql/errors.rb
rom-sql-1.3.0 lib/rom/sql/errors.rb
rom-sql-1.2.2 lib/rom/sql/errors.rb
rom-sql-1.2.1 lib/rom/sql/errors.rb
rom-sql-1.2.0 lib/rom/sql/errors.rb
rom-sql-1.1.2 lib/rom/sql/errors.rb
rom-sql-1.1.1 lib/rom/sql/errors.rb
rom-sql-1.1.0 lib/rom/sql/errors.rb
rom-sql-1.0.3 lib/rom/sql/errors.rb
rom-sql-1.0.2 lib/rom/sql/errors.rb
rom-sql-1.0.1 lib/rom/sql/errors.rb