Exception: Keycardai::OAuth::ResourceAccessError
- Defined in:
- lib/keycardai/oauth/errors.rb
Overview
Raised by AccessContext#access when a token cannot be handed out. The error_type identifies the condition: global_error (a context-wide error is set), resource_error (the named resource's exchange failed), or missing_token (the resource was never granted). For missing_token, available_resources lists what was granted.
Instance Attribute Summary collapse
- #available_resources ⇒ Array<String> readonly
-
#error_details ⇒ Object?
readonly
The recorded upstream error, when one exists.
-
#error_type ⇒ String
readonly
Global_error | resource_error | missing_token.
- #resource ⇒ String readonly
Instance Method Summary collapse
-
#initialize(message, resource:, error_type:, available_resources: [], error_details: nil) ⇒ ResourceAccessError
constructor
A new instance of ResourceAccessError.
Constructor Details
#initialize(message, resource:, error_type:, available_resources: [], error_details: nil) ⇒ ResourceAccessError
Returns a new instance of ResourceAccessError.
105 106 107 108 109 110 111 |
# File 'lib/keycardai/oauth/errors.rb', line 105 def initialize(, resource:, error_type:, available_resources: [], error_details: nil) super() @resource = resource @error_type = error_type @available_resources = available_resources @error_details = error_details end |
Instance Attribute Details
#available_resources ⇒ Array<String> (readonly)
101 102 103 |
# File 'lib/keycardai/oauth/errors.rb', line 101 def available_resources @available_resources end |
#error_details ⇒ Object? (readonly)
Returns the recorded upstream error, when one exists.
103 104 105 |
# File 'lib/keycardai/oauth/errors.rb', line 103 def error_details @error_details end |
#error_type ⇒ String (readonly)
Returns global_error | resource_error | missing_token.
99 100 101 |
# File 'lib/keycardai/oauth/errors.rb', line 99 def error_type @error_type end |
#resource ⇒ String (readonly)
97 98 99 |
# File 'lib/keycardai/oauth/errors.rb', line 97 def resource @resource end |