Exception: Unloq::APIError

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

Direct Known Subclasses

NotFoundError

Defined Under Namespace

Classes: NotFoundError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, body) ⇒ APIError

Returns a new instance of APIError.



6
7
8
9
10
# File 'lib/unloq/api_error.rb', line 6

def initialize(status, body)
  @status = status
  @body   = body
  super(message)
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



4
5
6
# File 'lib/unloq/api_error.rb', line 4

def body
  @body
end

#statusObject (readonly)

Returns the value of attribute status.



4
5
6
# File 'lib/unloq/api_error.rb', line 4

def status
  @status
end

Instance Method Details

#messageObject



12
13
14
# File 'lib/unloq/api_error.rb', line 12

def message
  "status_code:#{status} body:#{body.inspect}"
end