Exception: Melaya::MelayaError

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

Overview

Raised for non-2xx REST responses or ok:false envelopes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status: 0, code: nil, body: nil) ⇒ MelayaError

Returns a new instance of MelayaError.



8
9
10
11
12
13
# File 'lib/melaya/errors.rb', line 8

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

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



6
7
8
# File 'lib/melaya/errors.rb', line 6

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



6
7
8
# File 'lib/melaya/errors.rb', line 6

def code
  @code
end

#statusObject (readonly)

Returns the value of attribute status.



6
7
8
# File 'lib/melaya/errors.rb', line 6

def status
  @status
end