Exception: ActiveCampaignRb::Error
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- ActiveCampaignRb::Error
- Defined in:
- lib/active_campaign_rb/errors.rb
Overview
Base class error for almost all exceptions
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(response = nil, exception = nil) ⇒ Error
constructor
A new instance of Error.
- #message ⇒ Object
Constructor Details
#initialize(response = nil, exception = nil) ⇒ Error
Returns a new instance of Error.
10 11 12 13 14 |
# File 'lib/active_campaign_rb/errors.rb', line 10 def initialize(response = nil, exception = nil) self.response = response @exception = exception super end |
Instance Method Details
#message ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/active_campaign_rb/errors.rb', line 16 def if response.nil? super else <<~MESSAGE STATUS: #{response.status} URL: #{env.url} REQUEST HEADERS: #{env.request_headers} RESPONSE_HEADERS: #{env.response_headers} REQUEST_BODY: #{env.request_body}\n\n" RESPONSE_BODY: #{response.body}\n\n" MESSAGE end end |