Exception: Hookdeck::ApiError

Inherits:
Error
  • Object
show all
Defined in:
lib/hookdeck/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response = nil) ⇒ ApiError

Returns a new instance of ApiError.



28
29
30
31
32
33
# File 'lib/hookdeck/errors.rb', line 28

def initialize(response = nil)
  @response = response
  parse_error_response(response&.dig(:body))
  @request_id = response&.dig(:headers, 'x-request-id')
  super(message, request_id)
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



21
22
23
# File 'lib/hookdeck/errors.rb', line 21

def data
  @data
end

#handledObject (readonly)

Returns the value of attribute handled.



21
22
23
# File 'lib/hookdeck/errors.rb', line 21

def handled
  @handled
end

#messageObject (readonly)

Returns the value of attribute message.



21
22
23
# File 'lib/hookdeck/errors.rb', line 21

def message
  @message
end

#request_idObject (readonly)

Returns the value of attribute request_id.



21
22
23
# File 'lib/hookdeck/errors.rb', line 21

def request_id
  @request_id
end

#responseObject (readonly)

Returns the value of attribute response.



21
22
23
# File 'lib/hookdeck/errors.rb', line 21

def response
  @response
end

#statusObject (readonly)

Returns the value of attribute status.



21
22
23
# File 'lib/hookdeck/errors.rb', line 21

def status
  @status
end