Sha256: 2ade0507357ee219c8d6fdb0fd5ebf750268daadcc1783985a7ee3dab53d468a

Contents?: true

Size: 799 Bytes

Versions: 8

Compression:

Stored size: 799 Bytes

Contents

require "rom/sql/error"

module ROM
  module SQL
    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)

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rom-sql-0.8.0 lib/rom/sql/errors.rb
rom-sql-0.7.0 lib/rom/sql/errors.rb
rom-sql-0.7.0.rc1 lib/rom/sql/errors.rb
rom-sql-0.7.0.beta1 lib/rom/sql/errors.rb
rom-sql-0.6.1 lib/rom/sql/errors.rb
rom-sql-0.6.0 lib/rom/sql/errors.rb
rom-sql-0.6.0.rc1 lib/rom/sql/errors.rb
rom-sql-0.6.0.beta1 lib/rom/sql/errors.rb