class NexaasID::Client::Exception

Exception class raised whenever the underlying client receives an error response.

API

Documentation:

Public Class Methods

new(message, response) click to toggle source

Creates an instance of this exception.

@param [String] message The exception message. @param [#status, headers, body] response The client's HTTP response object.

Calls superclass method
# File lib/nexaas_id/client/exception.rb, line 11
def initialize(message, response)
  super(message)
  @response = response
end

Public Instance Methods

body() click to toggle source

@return [Integer] HTTP response's body.

# File lib/nexaas_id/client/exception.rb, line 27
def body
  @response ? @response.body : ''
end
headers() click to toggle source

@return [Integer] HTTP response's headers.

# File lib/nexaas_id/client/exception.rb, line 22
def headers
  @response.headers if @response
end
status() click to toggle source

@return [Integer] HTTP response's status.

# File lib/nexaas_id/client/exception.rb, line 17
def status
  @response.status if @response
end