類別:MCPAuthConfigError
當 mcp-auth 配置出現問題時所拋出的錯誤。
繼承自
建構子
建構子
new MCPAuthConfigError(code: string, message: string): MCPAuthConfigError;
參數
code
string
以 snake_case 格式表示的錯誤代碼。
message
string
易於理解的錯誤描述。
回傳值
MCPAuthConfigError
繼承自
屬性
cause?
optional cause: unknown;
繼承自
code
readonly code: string;
以 snake_case 格式表示的錯誤代碼。
繼承自
message
message: string;
繼承自
name
name: string = 'MCPAuthConfigError';
覆寫自
stack?
optional stack: string;
繼承自
prepareStackTrace()?
static optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any;
可選的堆疊追蹤格式化覆寫
參數
err
Error
stackTraces
CallSite
[]
回傳值
any
參見
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
繼承自
MCPAuthError
.prepareStackTrace
stackTraceLimit
static stackTraceLimit: number;
繼承自
方法
toJson()
toJson(showCause: boolean): Record<string, unknown>;
將錯誤轉換為適合 HTTP 回應的 JSON 格式。
參數
showCause
boolean
= false
是否在 JSON 回應中包含錯誤原因。
預設為 false
。
回傳值
Record
<string
, unknown
>
繼承自
captureStackTrace()
static captureStackTrace(targetObject: object, constructorOpt?: Function): void;
在目標物件上建立 .stack 屬性
參數
targetObject
object
constructorOpt?
Function
回傳值
void