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.


69
70
71
72
73
74
75
76
77
# File 'lib/signet/errors.rb', line 69

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.



83
84
85
# File 'lib/signet/errors.rb', line 83

def request
  @request
end

#responseArray (readonly)

The HTTP response that triggered this authentication error.

Returns:

  • (Array)

    A tuple of status, headers, and body.



89
90
91
# File 'lib/signet/errors.rb', line 89

def response
  @response
end