Exception: BellaBaxter::ApiError

Inherits:
Error
  • Object
show all
Defined in:
lib/bella_baxter/errors.rb

Overview

Raised when the server returns a non-2xx response.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, body) ⇒ ApiError

Returns a new instance of ApiError.



13
14
15
16
17
# File 'lib/bella_baxter/errors.rb', line 13

def initialize(status, body)
  @status = status
  @body   = body
  super("Bella Baxter API error #{status}: #{body}")
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



11
12
13
# File 'lib/bella_baxter/errors.rb', line 11

def body
  @body
end

#statusObject (readonly)

Returns the value of attribute status.



11
12
13
# File 'lib/bella_baxter/errors.rb', line 11

def status
  @status
end