Exception: Hanami::Model::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/hanami/model/error.rb

Overview

Default Error class

Since:

  • 0.5.1

Class Method Summary collapse

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.

Since:

  • 0.7.0



17
18
19
# File 'lib/hanami/model/error.rb', line 17

def self.for(exception)
  mapping.fetch(exception.class, self).new(exception)
end

.mappingObject

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.

Since:

  • 0.7.0



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.

Since:

  • 0.7.0



23
24
25
# File 'lib/hanami/model/error.rb', line 23

def self.register(external, internal)
  mapping.put_if_absent(external, internal)
end