Class: Peddler::Errors::Handler Private
- Inherits:
-
Object
- Object
- Peddler::Errors::Handler
- Defined in:
- lib/peddler/errors/handler.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #exception ⇒ Object readonly private
Class Method Summary collapse
- .call(exception) ⇒ Object private
- .parameters ⇒ Object private
Instance Method Summary collapse
- #handle ⇒ Object private
-
#initialize(exception) ⇒ Handler
constructor
private
A new instance of Handler.
Constructor Details
#initialize(exception) ⇒ Handler
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.
Returns a new instance of Handler.
23 24 25 |
# File 'lib/peddler/errors/handler.rb', line 23 def initialize(exception) @exception = exception end |
Instance Attribute Details
#exception ⇒ Object (readonly)
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/peddler/errors/handler.rb', line 21 def exception @exception end |
Class Method Details
.call(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.
13 14 15 |
# File 'lib/peddler/errors/handler.rb', line 13 def self.call(exception) new(exception).handle end |
.parameters ⇒ 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/peddler/errors/handler.rb', line 17 def self.parameters 1 end |
Instance Method Details
#handle ⇒ 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 30 31 32 |
# File 'lib/peddler/errors/handler.rb', line 27 def handle raise exception unless http_status_error? raise exception if bad_name_for_error_class? raise error_class.new(, exception) end |