Class: OAuthError
Defined in: src/auth/errors.ts:308
OAuth error.
Remarks
Thrown for OAuth 2.0 protocol errors. HTTP mapping: 400 Bad Request or 401 Unauthorized
See
Extends
Constructors
new OAuthError()
new OAuthError(
oauthError,errorDescription?,errorUri?):OAuthError
Defined in: src/auth/errors.ts:341
Creates a new OAuthError.
Parameters
oauthError
OAuth error code
"invalid_request" | "invalid_client" | "invalid_grant" | "unauthorized_client" | "unsupported_grant_type" | "invalid_scope" | "access_denied" | "server_error"
errorDescription?
string
Error description
errorUri?
string
Documentation URI
Returns
Overrides
Properties
cause?
readonlyoptionalcause:Error
Defined in: src/types/errors.ts:71
Original error that caused this error (if any).
Remarks
Error chaining allows tracking the full error context through multiple layers of the application. Useful for debugging complex error scenarios.
Example
try {
await fetchData();
} catch (err) {
throw new ValidationError('Failed to validate data', 'field', 'required', err as Error);
}
Inherited from
code
readonlycode:"OAUTH_ERROR"='OAUTH_ERROR'
Defined in: src/auth/errors.ts:309
Machine-readable error code.
Remarks
Error codes are unique identifiers for error types, enabling programmatic error handling (switch statements, error maps), error tracking in monitoring systems, and client-side error translation (i18n).
Overrides
errorDescription?
readonlyoptionalerrorDescription:string
Defined in: src/auth/errors.ts:327
OAuth error description.
errorUri?
readonlyoptionalerrorUri:string
Defined in: src/auth/errors.ts:332
OAuth error URI for documentation.
oauthError
readonlyoauthError:"invalid_request"|"invalid_client"|"invalid_grant"|"unauthorized_client"|"unsupported_grant_type"|"invalid_scope"|"access_denied"|"server_error"
Defined in: src/auth/errors.ts:314
OAuth error code per RFC 6749.