Exception: Qismo::HTTPRequestError

Inherits:
Error
  • Object
show all
Defined in:
lib/qismo/error.rb

Overview

Http request error

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status_code:, response_body:) ⇒ HTTPRequestError

Initiate error

Parameters:

  • message (String)
  • status_code (Integer)
  • response_body (String)


25
26
27
28
29
30
31
# File 'lib/qismo/error.rb', line 25

def initialize(message, status_code:, response_body:)
  super(message.to_s)

  @message = message
  @status_code = status_code
  @response_body = response_body
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



18
19
20
# File 'lib/qismo/error.rb', line 18

def message
  @message
end

#response_bodyObject (readonly)

Returns the value of attribute response_body.



18
19
20
# File 'lib/qismo/error.rb', line 18

def response_body
  @response_body
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



18
19
20
# File 'lib/qismo/error.rb', line 18

def status_code
  @status_code
end