Exception: RDStation::Error

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

Defined Under Namespace

Classes: ConflictingField, Default, ExpiredAccessToken, ExpiredCodeGrant, InvalidCredentials, ResourceNotFound, Unauthorized

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, api_response_error) ⇒ Error

Returns a new instance of Error.



6
7
8
9
10
11
# File 'lib/rdstation/error.rb', line 6

def initialize(message, api_response_error)
  @http_status = api_response_error.code
  @headers = api_response_error.headers
  @body = JSON.parse(api_response_error.body)
  super(message)
end

Instance Attribute Details

#body ⇒ Object (readonly)

Returns the value of attribute body.



4
5
6
# File 'lib/rdstation/error.rb', line 4

def body
  @body
end

#headers ⇒ Object (readonly)

Returns the value of attribute headers.



4
5
6
# File 'lib/rdstation/error.rb', line 4

def headers
  @headers
end

#http_status ⇒ Object (readonly)

Returns the value of attribute http_status.



4
5
6
# File 'lib/rdstation/error.rb', line 4

def http_status
  @http_status
end