Class in Errors · JavaScript & TypeScript
An OAuth call failed an input check, reached a local capacity limit, or failed during its request or response
class OAuthOperationError extends FluxerlyErrorclass OAuthOperationError
extends FluxerlyErrorA 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
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
}
): OAuthOperationErrorParameters
options-
apioptionalError -
ApiErrorDetail | null causeoptional-
unknown inputoptionalValidation -
InputValidationDetail | null oauthoptionalError -
string | null operation-
OAuthOperation outcome-
"unknown" | "rejected" | "notDispatched"| "unknown" | "rejected" | "notDispatched" provideroptionalCode -
Fluxer error code that this SDK version does not recognize, recorded as
details.providerCodeand named in the messageIgnored when
apiErroris present or the code does not have the shape of a Fluxer codestring | null reason-
| "input" | "network" | "timeout" | "rejected" | "busy" | "response" | "rateLimit"| "input" | "network" | "timeout" | "rejected" | "busy" | "response" | "rateLimit" retryoptionalAfter Ms -
number | null statusoptional-
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 | nullinputValidation #
Safe local validation facts when the SDK can identify a failed input rule, otherwise null
readonly inputValidation: InputValidationDetail | nullreadonly inputValidation:
| InputValidationDetail | nulloauthError #
Recognized RFC OAuth error code, otherwise null
readonly oauthError: string | nulloperation#
OAuth call that failed
readonly operation: OAuthOperationoutcome#
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 | nullstatus#
HTTP status when received, otherwise null
readonly status: number | nullInherited#
Inherited from Fluxerly: code, details, hint, to