Exception: Hanami::Model::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Hanami::Model::Error
- Defined in:
- lib/hanami/model/error.rb
Overview
Default Error class
Direct Known Subclasses
ConstraintViolationError, DatabaseError, InvalidCommandError, MigrationError, MissingPrimaryKeyError, UnknownAttributeError, UnknownDatabaseAdapterError, UnknownDatabaseTypeError
Class Method Summary collapse
- .for(exception) ⇒ Object private
- .mapping ⇒ Object private
- .register(external, internal) ⇒ Object private
Class Method Details
.for(exception) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
17 18 19 |
# File 'lib/hanami/model/error.rb', line 17 def self.for(exception) mapping.fetch(exception.class, self).new(exception) end |
.mapping ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
29 30 31 |
# File 'lib/hanami/model/error.rb', line 29 def self.mapping @__mapping__ end |
.register(external, internal) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 |
# File 'lib/hanami/model/error.rb', line 23 def self.register(external, internal) mapping.put_if_absent(external, internal) end |