Class: WebhookSystem::Job::ErrorResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/webhook_system/job.rb

Overview

Represents response for an exception we get when doing Faraday http call

Instance Method Summary collapse

Constructor Details

#initialize(exception) ⇒ ErrorResponse

Returns a new instance of ErrorResponse.



17
18
19
# File 'lib/webhook_system/job.rb', line 17

def initialize(exception)
  @exception = exception
end

Instance Method Details

#bodyObject



29
30
31
# File 'lib/webhook_system/job.rb', line 29

def body
  [@exception.class.name, @exception.message, *@exception.backtrace].join("\n")
end

#headersObject



25
26
27
# File 'lib/webhook_system/job.rb', line 25

def headers
  {}
end

#statusObject



21
22
23
# File 'lib/webhook_system/job.rb', line 21

def status
  0 # no HTTP response status as we got an exception while trying to perform the request
end