Class: Calendav::ErrorHandler
- Inherits:
-
Object
- Object
- Calendav::ErrorHandler
- Defined in:
- lib/calendav/error_handler.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(response) ⇒ ErrorHandler
constructor
A new instance of ErrorHandler.
Constructor Details
#initialize(response) ⇒ ErrorHandler
Returns a new instance of ErrorHandler.
11 12 13 |
# File 'lib/calendav/error_handler.rb', line 11 def initialize(response) @response = response end |
Class Method Details
.call ⇒ Object
7 8 9 |
# File 'lib/calendav/error_handler.rb', line 7 def self.call(...) new(...).call end |
Instance Method Details
#call ⇒ Object
15 16 17 18 19 20 |
# File 'lib/calendav/error_handler.rb', line 15 def call raise PreconditionError, response if status.code == 412 raise RedirectError, response if status.redirect? raise RequestError, response end |