Exception: Safire::Errors::TokenError
- Inherits:
-
OAuthError
- Object
- StandardError
- Error
- OAuthError
- Safire::Errors::TokenError
- Includes:
- ReceivesFields
- Defined in:
- lib/safire/errors.rb
Overview
Raised for token exchange or refresh failures.
Two usage paths:
-
HTTP failure: provide
status,error_code, and/orerror_description -
Structural failure (missing
access_token): providereceived_fields
Instance Attribute Summary collapse
-
#received_fields ⇒ Array<String>?
readonly
Field names present in an invalid token response (no values logged).
Attributes inherited from OAuthError
#error_code, #error_description, #status
Method Summary
Methods included from ReceivesFields
Methods inherited from OAuthError
Instance Attribute Details
#received_fields ⇒ Array<String>? (readonly)
Returns field names present in an invalid token response (no values logged).
180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/safire/errors.rb', line 180 class TokenError < OAuthError include ReceivesFields private def operation_label = 'Token request failed' def return super unless @received_fields&.any? "Missing access token in response; received fields: #{@received_fields.join(', ')}" end end |