Exception: AlmaApi::Error

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

Direct Known Subclasses

GatewayError, LogicalError, ServerError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, code = nil) ⇒ Error

Returns a new instance of Error.



18
19
20
21
# File 'lib/alma_api.rb', line 18

def initialize(message=nil, code=nil)
  @code = code.presence || DEFAULT_ERROR_CODE
  super(message.presence || DEFAULT_ERROR_MESSAGE)
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



16
17
18
# File 'lib/alma_api.rb', line 16

def code
  @code
end