Class: ADAL::ErrorResponse

Inherits:
TokenResponse show all
Includes:
Logging
Defined in:
lib/adal/token_response.rb

Overview

A token response that contains an error code.

Constant Summary collapse

OAUTH_FIELDS =
[:error, :error_description, :error_codes, :timestamp,
:trace_id, :correlation_id, :submit_url, :context]

Constants included from Logging

Logging::DEFAULT_LOG_LEVEL, Logging::DEFAULT_LOG_OUTPUT

Instance Method Summary collapse

Methods included from Logging

#logger

Methods inherited from TokenResponse

#error?, parse

Constructor Details

#initialize(fields = {}) ⇒ ErrorResponse

Constructs a Error from a collection of fields returned from a token endpoint.

Parameters:

  • Hash


138
139
140
141
142
# File 'lib/adal/token_response.rb', line 138

def initialize(fields = {})
  fields.each { |k, v| instance_variable_set("@#{k}", v) }
  logger.error("Parsed an ErrorResponse with error: #{@error} and error " \
               "description: #{@error_description}.")
end