Skip to main content

Class: MCPAuthBearerAuthError

Error thrown when there is an issue when authenticating with Bearer tokens.

Extends

Constructors

Constructor

new MCPAuthBearerAuthError(code: BearerAuthErrorCode, cause?: MCPAuthBearerAuthErrorDetails): MCPAuthBearerAuthError;

Parameters

code

BearerAuthErrorCode

cause?

MCPAuthBearerAuthErrorDetails

Returns

MCPAuthBearerAuthError

Overrides

MCPAuthError.constructor

Properties

cause?

readonly optional cause: MCPAuthBearerAuthErrorDetails;

Inherited from

MCPAuthError.cause


code

readonly code: BearerAuthErrorCode;

The error code in snake_case format.

Inherited from

MCPAuthError.code


message

message: string;

Inherited from

MCPAuthError.message


name

name: string = 'MCPAuthBearerAuthError';

Overrides

MCPAuthError.name


stack?

optional stack: string;

Inherited from

MCPAuthError.stack


prepareStackTrace()?

static optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any;

Optional override for formatting stack traces

Parameters

err

Error

stackTraces

CallSite[]

Returns

any

See

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

Inherited from

MCPAuthError.prepareStackTrace


stackTraceLimit

static stackTraceLimit: number;

Inherited from

MCPAuthError.stackTraceLimit

Methods

toJson()

toJson(showCause: boolean): Record<string, unknown>;

Converts the error to a HTTP response friendly JSON format.

Parameters

showCause

boolean = false

Whether to include the cause of the error in the JSON response. Defaults to false.

Returns

Record<string, unknown>

Overrides

MCPAuthError.toJson


captureStackTrace()

static captureStackTrace(targetObject: object, constructorOpt?: Function): void;

Create .stack property on a target object

Parameters

targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

MCPAuthError.captureStackTrace