Class: WebhookSystem::Job::ErrorResponse
- Inherits:
-
Object
- Object
- WebhookSystem::Job::ErrorResponse
- Defined in:
- lib/webhook_system/job.rb
Overview
Represents response for an exception we get when doing Faraday http call
Instance Method Summary collapse
- #body ⇒ Object
- #headers ⇒ Object
-
#initialize(exception) ⇒ ErrorResponse
constructor
A new instance of ErrorResponse.
- #status ⇒ Object
Constructor Details
#initialize(exception) ⇒ ErrorResponse
Returns a new instance of ErrorResponse.
19 20 21 |
# File 'lib/webhook_system/job.rb', line 19 def initialize(exception) @exception = exception end |
Instance Method Details
#body ⇒ Object
31 32 33 |
# File 'lib/webhook_system/job.rb', line 31 def body [@exception.class.name, @exception., *@exception.backtrace].join("\n") end |
#headers ⇒ Object
27 28 29 |
# File 'lib/webhook_system/job.rb', line 27 def headers {} end |
#status ⇒ Object
23 24 25 |
# File 'lib/webhook_system/job.rb', line 23 def status 0 # no HTTP response status as we got an exception while trying to perform the request end |