Exception: Basecamp::Oauth::DeviceFlowError
- Inherits:
-
OauthError
- Object
- StandardError
- OauthError
- Basecamp::Oauth::DeviceFlowError
- Defined in:
- lib/basecamp/oauth/device_flow_error.rb
Overview
A terminal RFC 8628 device-flow outcome. Carries a reason; the parent
OauthError type is DERIVED from that reason (SPEC.md ยง16) so callers can
branch on either the precise reason or the coarse type.
| reason | parent type |
|---|---|
:access_denied |
auth |
:expired |
auth |
:transport |
network (retryable) |
:unavailable |
validation |
:cancelled |
usage |
Constant Summary collapse
- REASON_TYPES =
Maps a device-flow reason to its parent OauthError type.
{ access_denied: "auth", expired: "auth", transport: "network", unavailable: "validation", cancelled: "usage" }.freeze
Instance Attribute Summary collapse
-
#reason ⇒ Symbol
the device-flow termination reason.
Instance Method Summary collapse
-
#initialize(reason, message, http_status: nil, hint: nil) ⇒ DeviceFlowError
constructor
A new instance of DeviceFlowError.
Constructor Details
#initialize(reason, message, http_status: nil, hint: nil) ⇒ DeviceFlowError
Returns a new instance of DeviceFlowError.
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/basecamp/oauth/device_flow_error.rb', line 34 def initialize(reason, , http_status: nil, hint: nil) super( REASON_TYPES.fetch(reason, "api_error"), , http_status: http_status, hint: hint, retryable: reason == :transport ) @reason = reason end |
Instance Attribute Details
#reason ⇒ Symbol
the device-flow termination reason
18 19 20 |
# File 'lib/basecamp/oauth/device_flow_error.rb', line 18 def reason @reason end |