On This Page

OAuthOperationError

Class in Errors · JavaScript & TypeScript

An OAuth call failed an input check, reached a local capacity limit, or failed during its request or response

A deadline expiry is also reported here. Inspect outcome before deciding whether to retry a code exchange, refresh or revocation. The SDK does not retry these operations automatically. Failures of fetchIdentity, fetchGuilds, fetchConnections and introspect set details.read for errors.isRetryable and do not imply a token change. SDK-reported discovery and transport failures retain sanitized causes with safe transport codes when available. Only reviewed error classifications are retained, not bodies, provider descriptions or credentials

class OAuthOperationError extends FluxerlyErrorclass OAuthOperationError
  extends FluxerlyError

Constructor#

Create the failure from an options object, with an optional underlying cause

new OAuthOperationError(
    options: {
        readonly apiError?: ApiErrorDetail | null
        readonly cause?: unknown
        readonly inputValidation?: InputValidationDetail | null
        readonly oauthError?: string | null
        readonly operation: OAuthOperation
        readonly outcome: "unknown" | "rejected" | "notDispatched"
        readonly providerCode?: string | null
        readonly reason:
            | "input" | "network" | "timeout" | "rejected" | "busy"
            | "response" | "rateLimit"
        readonly retryAfterMs?: number | null
        readonly status?: number | null
    }
): OAuthOperationErrornew OAuthOperationError(
  options: {
    readonly apiError?:
      | ApiErrorDetail | null
    readonly cause?: unknown
    readonly inputValidation?:
      | InputValidationDetail
      | null
    readonly oauthError?:
      | string | null
    readonly operation:
      OAuthOperation
    readonly outcome:
      | "unknown" | "rejected"
      | "notDispatched"
    readonly providerCode?:
      | string | null
    readonly reason:
      | "input" | "network"
      | "timeout" | "rejected"
      | "busy" | "response"
      | "rateLimit"
    readonly retryAfterMs?:
      | number | null
    readonly status?: number | null
  }
): OAuthOperationError

Parameters

options
apiError optional
ApiErrorDetail | null
cause optional
unknown
inputValidation optional
InputValidationDetail | null
oauthError optional
string | null
operation
OAuthOperation
outcome
"unknown" | "rejected" | "notDispatched"| "unknown" | "rejected"
| "notDispatched"
providerCode optional

Fluxer error code that this SDK version does not recognize, recorded as details.providerCode and named in the message

Ignored when apiError is present or the code does not have the shape of a Fluxer code

string | null
reason
| "input" | "network" | "timeout" | "rejected" | "busy" | "response"
| "rateLimit"| "input" | "network" | "timeout"
| "rejected" | "busy" | "response"
| "rateLimit"
retryAfterMs optional
number | null
status optional
number | null

Properties#

_tag#

Discriminator for narrowing this expected failure in either entry point

readonly _tag: "OAuthOperationError"

apiError#

Reviewed Fluxer HTTP error detail when the response uses the normal Fluxer envelope, otherwise null

readonly apiError: ApiErrorDetail | nullreadonly apiError:
  | ApiErrorDetail | null

inputValidation#

Safe local validation facts when the SDK can identify a failed input rule, otherwise null

readonly inputValidation: InputValidationDetail | nullreadonly inputValidation:
  | InputValidationDetail | null

oauthError#

Recognized RFC OAuth error code, otherwise null

readonly oauthError: string | null

operation#

OAuth call that failed

readonly operation: OAuthOperation

outcome#

Whether the request may have reached Fluxer, described by OperationOutcome

An unknown token-changing request may have taken effect, so retrying can consume or invalidate credentials again. Read calls cannot change tokens, even when their request outcome is unknown

readonly outcome: "unknown" | "rejected" | "notDispatched"readonly outcome:
  | "unknown" | "rejected"
  | "notDispatched"

reason#

Input validation, full local capacity, HTTP rejection, network failure, invalid response, deadline expiry or HTTP 429

readonly reason:
    | "input" | "network" | "timeout" | "rejected" | "busy"
    | "response" | "rateLimit"readonly reason:
  | "input" | "network" | "timeout"
  | "rejected" | "busy"
  | "response" | "rateLimit"

retryAfterMs#

Numeric Retry-After duration in milliseconds for a 429 response, or null when unavailable

readonly retryAfterMs: number | nullreadonly retryAfterMs:
  | number | null

status#

HTTP status when received, otherwise null

readonly status: number | null

Inherited#

Inherited from FluxerlyError: code, details, hint, toJSON