Exception: LemonwayOnboarding::Exceptions::RequestError

Inherits:
Error
  • Object
show all
Defined in:
lib/lemonway_onboarding/exceptions.rb

Overview

Exception raised when a request was not successful

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, code:, body:) ⇒ LemonwayOnboarding::Exceptions::RequestError

Initialize a request error. Contains response details.

Parameters:

  • message (String)

    The error message that is displayed

  • code (Integer)

    The HTTP response status code

  • body (String)

    The content of the response



18
19
20
21
22
# File 'lib/lemonway_onboarding/exceptions.rb', line 18

def initialize(message, code:, body:)
  @code = code
  @body = body
  super(message)
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



10
11
12
# File 'lib/lemonway_onboarding/exceptions.rb', line 10

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



10
11
12
# File 'lib/lemonway_onboarding/exceptions.rb', line 10

def code
  @code
end