Exception: FulfilApi::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/fulfil_api/error.rb

Overview

The Error is the base class for all FulfilApi errors, also used

for generic or unexpected errors.

Direct Known Subclasses

AccessToken::TypeInvalid

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, details: nil) ⇒ Error

Returns a new instance of Error.

Parameters:

  • message (String)

    The displayable error message for the receiver.

  • details (Hash) (defaults to: nil)

    Any additional details exposed by the issuer of the exception.



11
12
13
14
# File 'lib/fulfil_api/error.rb', line 11

def initialize(message, details: nil)
  @details = details
  super(message)
end

Instance Attribute Details

#detailsObject (readonly)

Returns the value of attribute details.



7
8
9
# File 'lib/fulfil_api/error.rb', line 7

def details
  @details
end

Instance Method Details

#messageString

Returns:

  • (String)


17
18
19
# File 'lib/fulfil_api/error.rb', line 17

def message
  "[FulfilApi::Error] #{super}"
end