Class: ActiveCampaign::ExceptionHandler
- Inherits:
-
Object
- Object
- ActiveCampaign::ExceptionHandler
- Defined in:
- lib/active-campaign-simple/exception_handler.rb
Constant Summary collapse
- ERRORS =
{ '404 Not Found' => ActiveCampaign::NotFoundError }
Instance Method Summary collapse
-
#initialize(error) ⇒ ExceptionHandler
constructor
A new instance of ExceptionHandler.
Constructor Details
#initialize(error) ⇒ ExceptionHandler
Returns a new instance of ExceptionHandler.
10 11 12 13 14 15 16 17 |
# File 'lib/active-campaign-simple/exception_handler.rb', line 10 def initialize(error) error_class = ERRORS[error.] if error_class raise error_class.new(error) else raise ActiveCampaign::APIError.new(error) end end |