This is the documentation for the v2 beta — looking for the v1 documentation?
Skip to content

MCP TypeScript SDK (V2) / @modelcontextprotocol/server-legacy / auth/errors

auth/errors

Classes

AccessDeniedError

Defined in: packages/server-legacy/src/auth/errors.ts:91

Access denied error - The resource owner or authorization server denied the request.

Extends

Constructors

Constructor

new AccessDeniedError(message, errorUri?): AccessDeniedError

Defined in: packages/server-legacy/src/auth/errors.ts:9

Parameters
message

string

errorUri?

string

Returns

AccessDeniedError

Inherited from

OAuthError.constructor

Properties

cause?

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

OAuthError.cause

errorUri?

readonly optional errorUri?: string

Defined in: packages/server-legacy/src/auth/errors.ts:11

Inherited from

OAuthError.errorUri

message

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

OAuthError.message

name

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

OAuthError.name

stack?

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

OAuthError.stack

errorCode

static errorCode: string = 'access_denied'

Defined in: packages/server-legacy/src/auth/errors.ts:92

Overrides

OAuthError.errorCode

stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

OAuthError.stackTraceLimit

Accessors

errorCode
Get Signature

get errorCode(): string

Defined in: packages/server-legacy/src/auth/errors.ts:33

Returns

string

Inherited from

OAuthError.errorCode

Methods

toResponseObject()

toResponseObject(): object

Defined in: packages/server-legacy/src/auth/errors.ts:20

Converts the error to a standard OAuth error response object

Returns

object

error

error: string

error_description?

optional error_description?: string

error_uri?

optional error_uri?: string

Inherited from

OAuthError.toResponseObject

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

OAuthError.captureStackTrace

isError()

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters
error

unknown

Returns

error is Error

Inherited from

OAuthError.isError

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

OAuthError.prepareStackTrace


CustomOAuthError

Defined in: packages/server-legacy/src/auth/errors.ts:177

A utility class for defining one-off error codes

Extends

Constructors

Constructor

new CustomOAuthError(customErrorCode, message, errorUri?): CustomOAuthError

Defined in: packages/server-legacy/src/auth/errors.ts:178

Parameters
customErrorCode

string

message

string

errorUri?

string

Returns

CustomOAuthError

Overrides

OAuthError.constructor

Properties

cause?

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

OAuthError.cause

errorUri?

readonly optional errorUri?: string

Defined in: packages/server-legacy/src/auth/errors.ts:11

Inherited from

OAuthError.errorUri

message

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

OAuthError.message

name

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

OAuthError.name

stack?

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

OAuthError.stack

errorCode

static errorCode: string

Defined in: packages/server-legacy/src/auth/errors.ts:7

Inherited from

OAuthError.errorCode

stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

OAuthError.stackTraceLimit

Accessors

errorCode
Get Signature

get errorCode(): string

Defined in: packages/server-legacy/src/auth/errors.ts:186

Returns

string

Overrides

OAuthError.errorCode

Methods

toResponseObject()

toResponseObject(): object

Defined in: packages/server-legacy/src/auth/errors.ts:20

Converts the error to a standard OAuth error response object

Returns

object

error

error: string

error_description?

optional error_description?: string

error_uri?

optional error_uri?: string

Inherited from

OAuthError.toResponseObject

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

OAuthError.captureStackTrace

isError()

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters
error

unknown

Returns

error is Error

Inherited from

OAuthError.isError

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

OAuthError.prepareStackTrace


InsufficientScopeError

Defined in: packages/server-legacy/src/auth/errors.ts:162

Insufficient scope error - The request requires higher privileges than provided by the access token.

Extends

Constructors

Constructor

new InsufficientScopeError(message, errorUri?): InsufficientScopeError

Defined in: packages/server-legacy/src/auth/errors.ts:9

Parameters
message

string

errorUri?

string

Returns

InsufficientScopeError

Inherited from

OAuthError.constructor

Properties

cause?

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

OAuthError.cause

errorUri?

readonly optional errorUri?: string

Defined in: packages/server-legacy/src/auth/errors.ts:11

Inherited from

OAuthError.errorUri

message

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

OAuthError.message

name

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

OAuthError.name

stack?

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

OAuthError.stack

errorCode

static errorCode: string = 'insufficient_scope'

Defined in: packages/server-legacy/src/auth/errors.ts:163

Overrides

OAuthError.errorCode

stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

OAuthError.stackTraceLimit

Accessors

errorCode
Get Signature

get errorCode(): string

Defined in: packages/server-legacy/src/auth/errors.ts:33

Returns

string

Inherited from

OAuthError.errorCode

Methods

toResponseObject()

toResponseObject(): object

Defined in: packages/server-legacy/src/auth/errors.ts:20

Converts the error to a standard OAuth error response object

Returns

object

error

error: string

error_description?

optional error_description?: string

error_uri?

optional error_uri?: string

Inherited from

OAuthError.toResponseObject

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

OAuthError.captureStackTrace

isError()

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters
error

unknown

Returns

error is Error

Inherited from

OAuthError.isError

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

OAuthError.prepareStackTrace


InvalidClientError

Defined in: packages/server-legacy/src/auth/errors.ts:51

Invalid client error - Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method).

Extends

Constructors

Constructor

new InvalidClientError(message, errorUri?): InvalidClientError

Defined in: packages/server-legacy/src/auth/errors.ts:9

Parameters
message

string

errorUri?

string

Returns

InvalidClientError

Inherited from

OAuthError.constructor

Properties

cause?

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

OAuthError.cause

errorUri?

readonly optional errorUri?: string

Defined in: packages/server-legacy/src/auth/errors.ts:11

Inherited from

OAuthError.errorUri

message

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

OAuthError.message

name

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

OAuthError.name

stack?

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

OAuthError.stack

errorCode

static errorCode: string = 'invalid_client'

Defined in: packages/server-legacy/src/auth/errors.ts:52

Overrides

OAuthError.errorCode

stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

OAuthError.stackTraceLimit

Accessors

errorCode
Get Signature

get errorCode(): string

Defined in: packages/server-legacy/src/auth/errors.ts:33

Returns

string

Inherited from

OAuthError.errorCode

Methods

toResponseObject()

toResponseObject(): object

Defined in: packages/server-legacy/src/auth/errors.ts:20

Converts the error to a standard OAuth error response object

Returns

object

error

error: string

error_description?

optional error_description?: string

error_uri?

optional error_uri?: string

Inherited from

OAuthError.toResponseObject

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

OAuthError.captureStackTrace

isError()

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters
error

unknown

Returns

error is Error

Inherited from

OAuthError.isError

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

OAuthError.prepareStackTrace


InvalidClientMetadataError

Defined in: packages/server-legacy/src/auth/errors.ts:155

Invalid client metadata error - The client metadata is invalid. (Custom error for dynamic client registration - RFC 7591)

Extends

Constructors

Constructor

new InvalidClientMetadataError(message, errorUri?): InvalidClientMetadataError

Defined in: packages/server-legacy/src/auth/errors.ts:9

Parameters
message

string

errorUri?

string

Returns

InvalidClientMetadataError

Inherited from

OAuthError.constructor

Properties

cause?

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

OAuthError.cause

errorUri?

readonly optional errorUri?: string

Defined in: packages/server-legacy/src/auth/errors.ts:11

Inherited from

OAuthError.errorUri

message

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

OAuthError.message

name

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

OAuthError.name

stack?

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

OAuthError.stack

errorCode

static errorCode: string = 'invalid_client_metadata'

Defined in: packages/server-legacy/src/auth/errors.ts:156

Overrides

OAuthError.errorCode

stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

OAuthError.stackTraceLimit

Accessors

errorCode
Get Signature

get errorCode(): string

Defined in: packages/server-legacy/src/auth/errors.ts:33

Returns

string

Inherited from

OAuthError.errorCode

Methods

toResponseObject()

toResponseObject(): object

Defined in: packages/server-legacy/src/auth/errors.ts:20

Converts the error to a standard OAuth error response object

Returns

object

error

error: string

error_description?

optional error_description?: string

error_uri?

optional error_uri?: string

Inherited from

OAuthError.toResponseObject

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

OAuthError.captureStackTrace

isError()

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters
error

unknown

Returns

error is Error

Inherited from

OAuthError.isError

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

OAuthError.prepareStackTrace


InvalidGrantError

Defined in: packages/server-legacy/src/auth/errors.ts:60

Invalid grant error - The provided authorization grant or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.

Extends

Constructors

Constructor

new InvalidGrantError(message, errorUri?): InvalidGrantError

Defined in: packages/server-legacy/src/auth/errors.ts:9

Parameters
message

string

errorUri?

string

Returns

InvalidGrantError

Inherited from

OAuthError.constructor

Properties

cause?

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

OAuthError.cause

errorUri?

readonly optional errorUri?: string

Defined in: packages/server-legacy/src/auth/errors.ts:11

Inherited from

OAuthError.errorUri

message

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

OAuthError.message

name

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

OAuthError.name

stack?

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

OAuthError.stack

errorCode

static errorCode: string = 'invalid_grant'

Defined in: packages/server-legacy/src/auth/errors.ts:61

Overrides

OAuthError.errorCode

stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

OAuthError.stackTraceLimit

Accessors

errorCode
Get Signature

get errorCode(): string

Defined in: packages/server-legacy/src/auth/errors.ts:33

Returns

string

Inherited from

OAuthError.errorCode

Methods

toResponseObject()

toResponseObject(): object

Defined in: packages/server-legacy/src/auth/errors.ts:20

Converts the error to a standard OAuth error response object

Returns

object

error

error: string

error_description?

optional error_description?: string

error_uri?

optional error_uri?: string

Inherited from

OAuthError.toResponseObject

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

OAuthError.captureStackTrace

isError()

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters
error

unknown

Returns

error is Error

Inherited from

OAuthError.isError

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

OAuthError.prepareStackTrace


InvalidRequestError

Defined in: packages/server-legacy/src/auth/errors.ts:43

Invalid request error - The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.

Extends

Constructors

Constructor

new InvalidRequestError(message, errorUri?): InvalidRequestError

Defined in: packages/server-legacy/src/auth/errors.ts:9

Parameters
message

string

errorUri?

string

Returns

InvalidRequestError

Inherited from

OAuthError.constructor

Properties

cause?

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

OAuthError.cause

errorUri?

readonly optional errorUri?: string

Defined in: packages/server-legacy/src/auth/errors.ts:11

Inherited from

OAuthError.errorUri

message

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

OAuthError.message

name

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

OAuthError.name

stack?

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

OAuthError.stack

errorCode

static errorCode: string = 'invalid_request'

Defined in: packages/server-legacy/src/auth/errors.ts:44

Overrides

OAuthError.errorCode

stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

OAuthError.stackTraceLimit

Accessors

errorCode
Get Signature

get errorCode(): string

Defined in: packages/server-legacy/src/auth/errors.ts:33

Returns

string

Inherited from

OAuthError.errorCode

Methods

toResponseObject()

toResponseObject(): object

Defined in: packages/server-legacy/src/auth/errors.ts:20

Converts the error to a standard OAuth error response object

Returns

object

error

error: string

error_description?

optional error_description?: string

error_uri?

optional error_uri?: string

Inherited from

OAuthError.toResponseObject

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

OAuthError.captureStackTrace

isError()

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters
error

unknown

Returns

error is Error

Inherited from

OAuthError.isError

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

OAuthError.prepareStackTrace


InvalidScopeError

Defined in: packages/server-legacy/src/auth/errors.ts:84

Invalid scope error - The requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner.

Extends

Constructors

Constructor

new InvalidScopeError(message, errorUri?): InvalidScopeError

Defined in: packages/server-legacy/src/auth/errors.ts:9

Parameters
message

string

errorUri?

string

Returns

InvalidScopeError

Inherited from

OAuthError.constructor

Properties

cause?

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

OAuthError.cause

errorUri?

readonly optional errorUri?: string

Defined in: packages/server-legacy/src/auth/errors.ts:11

Inherited from

OAuthError.errorUri

message

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

OAuthError.message

name

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

OAuthError.name

stack?

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

OAuthError.stack

errorCode

static errorCode: string = 'invalid_scope'

Defined in: packages/server-legacy/src/auth/errors.ts:85

Overrides

OAuthError.errorCode

stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

OAuthError.stackTraceLimit

Accessors

errorCode
Get Signature

get errorCode(): string

Defined in: packages/server-legacy/src/auth/errors.ts:33

Returns

string

Inherited from

OAuthError.errorCode

Methods

toResponseObject()

toResponseObject(): object

Defined in: packages/server-legacy/src/auth/errors.ts:20

Converts the error to a standard OAuth error response object

Returns

object

error

error: string

error_description?

optional error_description?: string

error_uri?

optional error_uri?: string

Inherited from

OAuthError.toResponseObject

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

OAuthError.captureStackTrace

isError()

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters
error

unknown

Returns

error is Error

Inherited from

OAuthError.isError

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

OAuthError.prepareStackTrace


InvalidTargetError

Defined in: packages/server-legacy/src/auth/errors.ts:170

Invalid target error - The requested resource is invalid, missing, unknown, or malformed. (Custom error for resource indicators - RFC 8707)

Extends

Constructors

Constructor

new InvalidTargetError(message, errorUri?): InvalidTargetError

Defined in: packages/server-legacy/src/auth/errors.ts:9

Parameters
message

string

errorUri?

string

Returns

InvalidTargetError

Inherited from

OAuthError.constructor

Properties

cause?

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

OAuthError.cause

errorUri?

readonly optional errorUri?: string

Defined in: packages/server-legacy/src/auth/errors.ts:11

Inherited from

OAuthError.errorUri

message

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

OAuthError.message

name

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

OAuthError.name

stack?

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

OAuthError.stack

errorCode

static errorCode: string = 'invalid_target'

Defined in: packages/server-legacy/src/auth/errors.ts:171

Overrides

OAuthError.errorCode

stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

OAuthError.stackTraceLimit

Accessors

errorCode
Get Signature

get errorCode(): string

Defined in: packages/server-legacy/src/auth/errors.ts:33

Returns

string

Inherited from

OAuthError.errorCode

Methods

toResponseObject()

toResponseObject(): object

Defined in: packages/server-legacy/src/auth/errors.ts:20

Converts the error to a standard OAuth error response object

Returns

object

error

error: string

error_description?

optional error_description?: string

error_uri?

optional error_uri?: string

Inherited from

OAuthError.toResponseObject

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

OAuthError.captureStackTrace

isError()

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters
error

unknown

Returns

error is Error

Inherited from

OAuthError.isError

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

OAuthError.prepareStackTrace


InvalidTokenError

Defined in: packages/server-legacy/src/auth/errors.ts:131

Invalid token error - The access token provided is expired, revoked, malformed, or invalid for other reasons.

Extends

Constructors

Constructor

new InvalidTokenError(message, errorUri?): InvalidTokenError

Defined in: packages/server-legacy/src/auth/errors.ts:9

Parameters
message

string

errorUri?

string

Returns

InvalidTokenError

Inherited from

OAuthError.constructor

Properties

cause?

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

OAuthError.cause

errorUri?

readonly optional errorUri?: string

Defined in: packages/server-legacy/src/auth/errors.ts:11

Inherited from

OAuthError.errorUri

message

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

OAuthError.message

name

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

OAuthError.name

stack?

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

OAuthError.stack

errorCode

static errorCode: string = 'invalid_token'

Defined in: packages/server-legacy/src/auth/errors.ts:132

Overrides

OAuthError.errorCode

stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

OAuthError.stackTraceLimit

Accessors

errorCode
Get Signature

get errorCode(): string

Defined in: packages/server-legacy/src/auth/errors.ts:33

Returns

string

Inherited from

OAuthError.errorCode

Methods

toResponseObject()

toResponseObject(): object

Defined in: packages/server-legacy/src/auth/errors.ts:20

Converts the error to a standard OAuth error response object

Returns

object

error

error: string

error_description?

optional error_description?: string

error_uri?

optional error_uri?: string

Inherited from

OAuthError.toResponseObject

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

OAuthError.captureStackTrace

isError()

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters
error

unknown

Returns

error is Error

Inherited from

OAuthError.isError

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

OAuthError.prepareStackTrace


MethodNotAllowedError

Defined in: packages/server-legacy/src/auth/errors.ts:139

Method not allowed error - The HTTP method used is not allowed for this endpoint. (Custom, non-standard error)

Extends

Constructors

Constructor

new MethodNotAllowedError(message, errorUri?): MethodNotAllowedError

Defined in: packages/server-legacy/src/auth/errors.ts:9

Parameters
message

string

errorUri?

string

Returns

MethodNotAllowedError

Inherited from

OAuthError.constructor

Properties

cause?

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

OAuthError.cause

errorUri?

readonly optional errorUri?: string

Defined in: packages/server-legacy/src/auth/errors.ts:11

Inherited from

OAuthError.errorUri

message

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

OAuthError.message

name

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

OAuthError.name

stack?

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

OAuthError.stack

errorCode

static errorCode: string = 'method_not_allowed'

Defined in: packages/server-legacy/src/auth/errors.ts:140

Overrides

OAuthError.errorCode

stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

OAuthError.stackTraceLimit

Accessors

errorCode
Get Signature

get errorCode(): string

Defined in: packages/server-legacy/src/auth/errors.ts:33

Returns

string

Inherited from

OAuthError.errorCode

Methods

toResponseObject()

toResponseObject(): object

Defined in: packages/server-legacy/src/auth/errors.ts:20

Converts the error to a standard OAuth error response object

Returns

object

error

error: string

error_description?

optional error_description?: string

error_uri?

optional error_uri?: string

Inherited from

OAuthError.toResponseObject

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

OAuthError.captureStackTrace

isError()

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters
error

unknown

Returns

error is Error

Inherited from

OAuthError.isError

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

OAuthError.prepareStackTrace


OAuthError

Defined in: packages/server-legacy/src/auth/errors.ts:6

Base class for all OAuth errors

Extends

  • Error

Extended by

Constructors

Constructor

new OAuthError(message, errorUri?): OAuthError

Defined in: packages/server-legacy/src/auth/errors.ts:9

Parameters
message

string

errorUri?

string

Returns

OAuthError

Overrides

Error.constructor

Properties

cause?

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

Error.cause

errorUri?

readonly optional errorUri?: string

Defined in: packages/server-legacy/src/auth/errors.ts:11

message

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

Error.message

name

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

Error.name

stack?

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

Error.stack

errorCode

static errorCode: string

Defined in: packages/server-legacy/src/auth/errors.ts:7

stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

Error.stackTraceLimit

Accessors

errorCode
Get Signature

get errorCode(): string

Defined in: packages/server-legacy/src/auth/errors.ts:33

Returns

string

Methods

toResponseObject()

toResponseObject(): object

Defined in: packages/server-legacy/src/auth/errors.ts:20

Converts the error to a standard OAuth error response object

Returns

object

error

error: string

error_description?

optional error_description?: string

error_uri?

optional error_uri?: string

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

Error.captureStackTrace

isError()

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters
error

unknown

Returns

error is Error

Inherited from

Error.isError

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

Error.prepareStackTrace


ServerError

Defined in: packages/server-legacy/src/auth/errors.ts:99

Server error - The authorization server encountered an unexpected condition that prevented it from fulfilling the request.

Extends

Constructors

Constructor

new ServerError(message, errorUri?): ServerError

Defined in: packages/server-legacy/src/auth/errors.ts:9

Parameters
message

string

errorUri?

string

Returns

ServerError

Inherited from

OAuthError.constructor

Properties

cause?

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

OAuthError.cause

errorUri?

readonly optional errorUri?: string

Defined in: packages/server-legacy/src/auth/errors.ts:11

Inherited from

OAuthError.errorUri

message

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

OAuthError.message

name

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

OAuthError.name

stack?

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

OAuthError.stack

errorCode

static errorCode: string = 'server_error'

Defined in: packages/server-legacy/src/auth/errors.ts:100

Overrides

OAuthError.errorCode

stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

OAuthError.stackTraceLimit

Accessors

errorCode
Get Signature

get errorCode(): string

Defined in: packages/server-legacy/src/auth/errors.ts:33

Returns

string

Inherited from

OAuthError.errorCode

Methods

toResponseObject()

toResponseObject(): object

Defined in: packages/server-legacy/src/auth/errors.ts:20

Converts the error to a standard OAuth error response object

Returns

object

error

error: string

error_description?

optional error_description?: string

error_uri?

optional error_uri?: string

Inherited from

OAuthError.toResponseObject

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

OAuthError.captureStackTrace

isError()

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters
error

unknown

Returns

error is Error

Inherited from

OAuthError.isError

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

OAuthError.prepareStackTrace


TemporarilyUnavailableError

Defined in: packages/server-legacy/src/auth/errors.ts:107

Temporarily unavailable error - The authorization server is currently unable to handle the request due to a temporary overloading or maintenance of the server.

Extends

Constructors

Constructor

new TemporarilyUnavailableError(message, errorUri?): TemporarilyUnavailableError

Defined in: packages/server-legacy/src/auth/errors.ts:9

Parameters
message

string

errorUri?

string

Returns

TemporarilyUnavailableError

Inherited from

OAuthError.constructor

Properties

cause?

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

OAuthError.cause

errorUri?

readonly optional errorUri?: string

Defined in: packages/server-legacy/src/auth/errors.ts:11

Inherited from

OAuthError.errorUri

message

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

OAuthError.message

name

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

OAuthError.name

stack?

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

OAuthError.stack

errorCode

static errorCode: string = 'temporarily_unavailable'

Defined in: packages/server-legacy/src/auth/errors.ts:108

Overrides

OAuthError.errorCode

stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

OAuthError.stackTraceLimit

Accessors

errorCode
Get Signature

get errorCode(): string

Defined in: packages/server-legacy/src/auth/errors.ts:33

Returns

string

Inherited from

OAuthError.errorCode

Methods

toResponseObject()

toResponseObject(): object

Defined in: packages/server-legacy/src/auth/errors.ts:20

Converts the error to a standard OAuth error response object

Returns

object

error

error: string

error_description?

optional error_description?: string

error_uri?

optional error_uri?: string

Inherited from

OAuthError.toResponseObject

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

OAuthError.captureStackTrace

isError()

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters
error

unknown

Returns

error is Error

Inherited from

OAuthError.isError

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

OAuthError.prepareStackTrace


TooManyRequestsError

Defined in: packages/server-legacy/src/auth/errors.ts:147

Too many requests error - Rate limit exceeded. (Custom, non-standard error based on RFC 6585)

Extends

Constructors

Constructor

new TooManyRequestsError(message, errorUri?): TooManyRequestsError

Defined in: packages/server-legacy/src/auth/errors.ts:9

Parameters
message

string

errorUri?

string

Returns

TooManyRequestsError

Inherited from

OAuthError.constructor

Properties

cause?

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

OAuthError.cause

errorUri?

readonly optional errorUri?: string

Defined in: packages/server-legacy/src/auth/errors.ts:11

Inherited from

OAuthError.errorUri

message

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

OAuthError.message

name

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

OAuthError.name

stack?

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

OAuthError.stack

errorCode

static errorCode: string = 'too_many_requests'

Defined in: packages/server-legacy/src/auth/errors.ts:148

Overrides

OAuthError.errorCode

stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

OAuthError.stackTraceLimit

Accessors

errorCode
Get Signature

get errorCode(): string

Defined in: packages/server-legacy/src/auth/errors.ts:33

Returns

string

Inherited from

OAuthError.errorCode

Methods

toResponseObject()

toResponseObject(): object

Defined in: packages/server-legacy/src/auth/errors.ts:20

Converts the error to a standard OAuth error response object

Returns

object

error

error: string

error_description?

optional error_description?: string

error_uri?

optional error_uri?: string

Inherited from

OAuthError.toResponseObject

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

OAuthError.captureStackTrace

isError()

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters
error

unknown

Returns

error is Error

Inherited from

OAuthError.isError

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

OAuthError.prepareStackTrace


UnauthorizedClientError

Defined in: packages/server-legacy/src/auth/errors.ts:68

Unauthorized client error - The authenticated client is not authorized to use this authorization grant type.

Extends

Constructors

Constructor

new UnauthorizedClientError(message, errorUri?): UnauthorizedClientError

Defined in: packages/server-legacy/src/auth/errors.ts:9

Parameters
message

string

errorUri?

string

Returns

UnauthorizedClientError

Inherited from

OAuthError.constructor

Properties

cause?

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

OAuthError.cause

errorUri?

readonly optional errorUri?: string

Defined in: packages/server-legacy/src/auth/errors.ts:11

Inherited from

OAuthError.errorUri

message

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

OAuthError.message

name

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

OAuthError.name

stack?

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

OAuthError.stack

errorCode

static errorCode: string = 'unauthorized_client'

Defined in: packages/server-legacy/src/auth/errors.ts:69

Overrides

OAuthError.errorCode

stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

OAuthError.stackTraceLimit

Accessors

errorCode
Get Signature

get errorCode(): string

Defined in: packages/server-legacy/src/auth/errors.ts:33

Returns

string

Inherited from

OAuthError.errorCode

Methods

toResponseObject()

toResponseObject(): object

Defined in: packages/server-legacy/src/auth/errors.ts:20

Converts the error to a standard OAuth error response object

Returns

object

error

error: string

error_description?

optional error_description?: string

error_uri?

optional error_uri?: string

Inherited from

OAuthError.toResponseObject

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

OAuthError.captureStackTrace

isError()

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters
error

unknown

Returns

error is Error

Inherited from

OAuthError.isError

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

OAuthError.prepareStackTrace


UnsupportedGrantTypeError

Defined in: packages/server-legacy/src/auth/errors.ts:76

Unsupported grant type error - The authorization grant type is not supported by the authorization server.

Extends

Constructors

Constructor

new UnsupportedGrantTypeError(message, errorUri?): UnsupportedGrantTypeError

Defined in: packages/server-legacy/src/auth/errors.ts:9

Parameters
message

string

errorUri?

string

Returns

UnsupportedGrantTypeError

Inherited from

OAuthError.constructor

Properties

cause?

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

OAuthError.cause

errorUri?

readonly optional errorUri?: string

Defined in: packages/server-legacy/src/auth/errors.ts:11

Inherited from

OAuthError.errorUri

message

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

OAuthError.message

name

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

OAuthError.name

stack?

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

OAuthError.stack

errorCode

static errorCode: string = 'unsupported_grant_type'

Defined in: packages/server-legacy/src/auth/errors.ts:77

Overrides

OAuthError.errorCode

stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

OAuthError.stackTraceLimit

Accessors

errorCode
Get Signature

get errorCode(): string

Defined in: packages/server-legacy/src/auth/errors.ts:33

Returns

string

Inherited from

OAuthError.errorCode

Methods

toResponseObject()

toResponseObject(): object

Defined in: packages/server-legacy/src/auth/errors.ts:20

Converts the error to a standard OAuth error response object

Returns

object

error

error: string

error_description?

optional error_description?: string

error_uri?

optional error_uri?: string

Inherited from

OAuthError.toResponseObject

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

OAuthError.captureStackTrace

isError()

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters
error

unknown

Returns

error is Error

Inherited from

OAuthError.isError

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

OAuthError.prepareStackTrace


UnsupportedResponseTypeError

Defined in: packages/server-legacy/src/auth/errors.ts:115

Unsupported response type error - The authorization server does not support obtaining an authorization code using this method.

Extends

Constructors

Constructor

new UnsupportedResponseTypeError(message, errorUri?): UnsupportedResponseTypeError

Defined in: packages/server-legacy/src/auth/errors.ts:9

Parameters
message

string

errorUri?

string

Returns

UnsupportedResponseTypeError

Inherited from

OAuthError.constructor

Properties

cause?

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

OAuthError.cause

errorUri?

readonly optional errorUri?: string

Defined in: packages/server-legacy/src/auth/errors.ts:11

Inherited from

OAuthError.errorUri

message

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

OAuthError.message

name

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

OAuthError.name

stack?

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

OAuthError.stack

errorCode

static errorCode: string = 'unsupported_response_type'

Defined in: packages/server-legacy/src/auth/errors.ts:116

Overrides

OAuthError.errorCode

stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

OAuthError.stackTraceLimit

Accessors

errorCode
Get Signature

get errorCode(): string

Defined in: packages/server-legacy/src/auth/errors.ts:33

Returns

string

Inherited from

OAuthError.errorCode

Methods

toResponseObject()

toResponseObject(): object

Defined in: packages/server-legacy/src/auth/errors.ts:20

Converts the error to a standard OAuth error response object

Returns

object

error

error: string

error_description?

optional error_description?: string

error_uri?

optional error_uri?: string

Inherited from

OAuthError.toResponseObject

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

OAuthError.captureStackTrace

isError()

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters
error

unknown

Returns

error is Error

Inherited from

OAuthError.isError

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

OAuthError.prepareStackTrace


UnsupportedTokenTypeError

Defined in: packages/server-legacy/src/auth/errors.ts:123

Unsupported token type error - The authorization server does not support the requested token type.

Extends

Constructors

Constructor

new UnsupportedTokenTypeError(message, errorUri?): UnsupportedTokenTypeError

Defined in: packages/server-legacy/src/auth/errors.ts:9

Parameters
message

string

errorUri?

string

Returns

UnsupportedTokenTypeError

Inherited from

OAuthError.constructor

Properties

cause?

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

OAuthError.cause

errorUri?

readonly optional errorUri?: string

Defined in: packages/server-legacy/src/auth/errors.ts:11

Inherited from

OAuthError.errorUri

message

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

OAuthError.message

name

name: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

OAuthError.name

stack?

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

OAuthError.stack

errorCode

static errorCode: string = 'unsupported_token_type'

Defined in: packages/server-legacy/src/auth/errors.ts:124

Overrides

OAuthError.errorCode

stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

OAuthError.stackTraceLimit

Accessors

errorCode
Get Signature

get errorCode(): string

Defined in: packages/server-legacy/src/auth/errors.ts:33

Returns

string

Inherited from

OAuthError.errorCode

Methods

toResponseObject()

toResponseObject(): object

Defined in: packages/server-legacy/src/auth/errors.ts:20

Converts the error to a standard OAuth error response object

Returns

object

error

error: string

error_description?

optional error_description?: string

error_uri?

optional error_uri?: string

Inherited from

OAuthError.toResponseObject

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

OAuthError.captureStackTrace

isError()

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

Parameters
error

unknown

Returns

error is Error

Inherited from

OAuthError.isError

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@24.12.0/node_modules/@types/node/globals.d.ts:56

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

OAuthError.prepareStackTrace

Variables

OAUTH_ERRORS

const OAUTH_ERRORS: object

Defined in: packages/server-legacy/src/auth/errors.ts:194

A full list of all OAuthErrors, enabling parsing from error responses

Index Signature

[key: string]: typeof InvalidRequestError