Zum Hauptinhalt springen

Klasse: MCPAuthBearerAuthError

Fehler, der ausgelöst wird, wenn es ein Problem bei der Authentifizierung mit Bearer-Tokens gibt.

Erbt von

Konstruktoren

Konstruktor

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

Parameter

code

BearerAuthErrorCode

cause?

MCPAuthBearerAuthErrorDetails

Rückgabewert

MCPAuthBearerAuthError

Überschreibt

MCPAuthError.constructor

Eigenschaften

cause?

readonly optional cause: MCPAuthBearerAuthErrorDetails;

Geerbt von

MCPAuthError.cause


code

readonly code: BearerAuthErrorCode;

Der Fehlercode im snake_case-Format.

Geerbt von

MCPAuthError.code


message

message: string;

Geerbt von

MCPAuthError.message


name

name: string = 'MCPAuthBearerAuthError';

Überschreibt

MCPAuthError.name


stack?

optional stack: string;

Geerbt von

MCPAuthError.stack


prepareStackTrace()?

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

Optionale Überschreibung zur Formatierung von Stacktraces

Parameter

err

Error

stackTraces

CallSite[]

Rückgabewert

any

Siehe

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

Geerbt von

MCPAuthError.prepareStackTrace


stackTraceLimit

static stackTraceLimit: number;

Geerbt von

MCPAuthError.stackTraceLimit

Methoden

toJson()

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

Konvertiert den Fehler in ein HTTP-Response-freundliches JSON-Format.

Parameter

showCause

boolean = false

Gibt an, ob die Ursache des Fehlers in der JSON-Antwort enthalten sein soll. Standardmäßig false.

Rückgabewert

Record<string, unknown>

Überschreibt

MCPAuthError.toJson


captureStackTrace()

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

Erstellt die .stack-Eigenschaft auf einem Zielobjekt

Parameter

targetObject

object

constructorOpt?

Function

Rückgabewert

void

Geerbt von

MCPAuthError.captureStackTrace