Sha256: f08f2aec8bea463148ae64b18ccdf9c9a1d6c63267d2b43e2461e5d9fcf0e016

Contents?: true

Size: 1.2 KB

Versions: 12

Compression:

Stored size: 1.2 KB

Contents

# frozen_string_literal: true

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.6.4 lib/rom/sql/errors.rb
rom-sql-3.6.3 lib/rom/sql/errors.rb
rom-sql-3.6.2 lib/rom/sql/errors.rb
rom-sql-3.6.1 lib/rom/sql/errors.rb
rom-sql-3.6.0 lib/rom/sql/errors.rb
rom-sql-3.5.0 lib/rom/sql/errors.rb
rom-sql-3.4.0 lib/rom/sql/errors.rb
rom-sql-3.3.3 lib/rom/sql/errors.rb
rom-sql-3.3.2 lib/rom/sql/errors.rb
rom-sql-3.3.1 lib/rom/sql/errors.rb
rom-sql-3.3.0 lib/rom/sql/errors.rb
rom-sql-3.2.0 lib/rom/sql/errors.rb