Exception: Signet::AuthorizationError

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

Overview

An error indicating the 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.



51
52
53
54
55
56
57
58
59
# File 'lib/signet/errors.rb', line 51

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.



65
66
67
# File 'lib/signet/errors.rb', line 65

def request
  @request
end

#responseArray (readonly)

The HTTP response that triggered this authentication error.

Returns:

  • (Array)

    A tuple of status, headers, and body.



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

def response
  @response
end