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.
18 19 20 |
# File 'lib/peddler/errors/handler.rb', line 18 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.
16 17 18 |
# File 'lib/peddler/errors/handler.rb', line 16 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.
8 9 10 |
# File 'lib/peddler/errors/handler.rb', line 8 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.
12 13 14 |
# File 'lib/peddler/errors/handler.rb', line 12 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.
22 23 24 25 26 27 28 29 30 |
# File 'lib/peddler/errors/handler.rb', line 22 def handle if http_status_error? raise error_class.new(exception.response., exception) else raise exception end rescue NameError raise exception end |