Exception: Basecamp::Oauth::DiscoverySelectionError
- Inherits:
-
OauthError
- Object
- StandardError
- OauthError
- Basecamp::Oauth::DiscoverySelectionError
- Defined in:
- lib/basecamp/oauth/discovery_selection_error.rb
Overview
A hard resource-first selection/validation failure. Raised — never returned as a fallback — so no consumer can convert it into a Launchpad request.
The reason is one of:
ambiguous_issuers, expected_issuer_unavailable, invalid_issuer_origin,
as_fetch_failed, issuer_mismatch, capability_unavailable.
Instance Attribute Summary collapse
-
#reason ⇒ String
the hard-failure classification.
Instance Method Summary collapse
-
#initialize(reason, message, http_status: nil) ⇒ DiscoverySelectionError
constructor
A new instance of DiscoverySelectionError.
Constructor Details
#initialize(reason, message, http_status: nil) ⇒ DiscoverySelectionError
Returns a new instance of DiscoverySelectionError.
19 20 21 22 23 24 25 26 27 |
# File 'lib/basecamp/oauth/discovery_selection_error.rb', line 19 def initialize(reason, , http_status: nil) # Only capability_unavailable is consumer/usage-shaped (validation). Every # other reason — including expected_issuer_unavailable — is an AS metadata # fault surfaced as api_error, matching the other four SDKs (an issuer the # resource does not advertise is a metadata fault, not a caller-usage one). type = reason == "capability_unavailable" ? "validation" : "api_error" super(type, , http_status: http_status) @reason = reason end |
Instance Attribute Details
#reason ⇒ String
the hard-failure classification
13 14 15 |
# File 'lib/basecamp/oauth/discovery_selection_error.rb', line 13 def reason @reason end |