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.
15 16 17 |
# File 'lib/hanami/model/error.rb', line 15 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.
27 28 29 |
# File 'lib/hanami/model/error.rb', line 27 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.
21 22 23 |
# File 'lib/hanami/model/error.rb', line 21 def self.register(external, internal) mapping.put_if_absent(external, internal) end |