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.
21 22 23 |
# File 'lib/peddler/errors/handler.rb', line 21 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.
19 20 21 |
# File 'lib/peddler/errors/handler.rb', line 19 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.
11 12 13 |
# File 'lib/peddler/errors/handler.rb', line 11 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.
15 16 17 |
# File 'lib/peddler/errors/handler.rb', line 15 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.
25 26 27 28 29 30 |
# File 'lib/peddler/errors/handler.rb', line 25 def handle raise exception unless http_status_error? raise exception if bad_name_for_error_class? raise error_class.new(, exception) end |