Exception: Signet::AuthorizationError

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

Overview

An error indicating the remote server refused to authorize the client.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, options = {}) ⇒ AuthorizationError

Creates a new authentication error.

Parameters:

  • message (String)

    A message describing the error.

  • options (Hash) (defaults to: {})

    The configuration parameters for the request.

    • :request - A Faraday::Request object. Optional.

    • :response - A Faraday::Response object. Optional.

    • :code - An error code.

    • :description - Human-readable text intended to be used to assist in resolving the error condition.

    • :uri - A URI identifying a human-readable web page with additional information about the error, indended for the resource owner.



58
59
60
61
62
63
64
65
66
# File 'lib/signet/errors.rb', line 58

def initialize(message, options={})
  super(message)
  @options = options
  @request = options[:request]
  @response = options[:response]
  @code = options[:code]
  @description = options[:description]
  @uri = Addressable::URI.parse(options[:uri])
end

Instance Attribute Details

#requestArray (readonly)

The HTTP request that triggered this authentication error.

Returns:

  • (Array)

    A tuple of method, uri, headers, and body.



72
73
74
# File 'lib/signet/errors.rb', line 72

def request
  @request
end

#responseArray (readonly)

The HTTP response that triggered this authentication error.

Returns:

  • (Array)

    A tuple of status, headers, and body.



78
79
80
# File 'lib/signet/errors.rb', line 78

def response
  @response
end