Sha256: 1f288b0f5f40ee38ebe50a913c57782c1dce91c793045210964f4ad074dd13c7

Contents?: true

Size: 1.17 KB

Versions: 12

Compression:

Stored size: 1.17 KB

Contents

require 'sequel/deprecated'
require 'sequel/exceptions'

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)
    MigrationError            = Class.new(StandardError)
    UnsupportedConversion     = Class.new(MigrationError)

    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

12 entries across 12 versions & 1 rubygems

Version Path
rom-sql-3.1.0 lib/rom/sql/errors.rb
rom-sql-3.0.1 lib/rom/sql/errors.rb
rom-sql-3.0.0 lib/rom/sql/errors.rb
rom-sql-2.5.0 lib/rom/sql/errors.rb
rom-sql-2.4.0 lib/rom/sql/errors.rb
rom-sql-2.3.0 lib/rom/sql/errors.rb
rom-sql-2.2.1 lib/rom/sql/errors.rb
rom-sql-2.2.0 lib/rom/sql/errors.rb
rom-sql-2.1.0 lib/rom/sql/errors.rb
rom-sql-2.0.0 lib/rom/sql/errors.rb
rom-sql-2.0.0.rc1 lib/rom/sql/errors.rb
rom-sql-2.0.0.beta3 lib/rom/sql/errors.rb