lib/rom/sql/errors.rb in rom-sql-0.8.0 vs lib/rom/sql/errors.rb in rom-sql-0.9.0
- old
+ new
@@ -1,18 +1,21 @@
-require "rom/sql/error"
+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)
ERROR_MAP = {
Sequel::DatabaseError => DatabaseError,
+ Sequel::ConstraintViolation => ConstraintError,
Sequel::NotNullConstraintViolation => NotNullConstraintError,
Sequel::UniqueConstraintViolation => UniqueConstraintError,
Sequel::ForeignKeyConstraintViolation => ForeignKeyConstraintError,
Sequel::CheckConstraintViolation => CheckConstraintError
}.freeze