Huggingface.js 文档

类别:InferenceClientError

Hugging Face's logo
加入 Hugging Face 社区

并获得增强的文档体验

开始使用

类别:InferenceClientError

所有推理相关错误的基类。

继承关系

构造函数

构造函数

new InferenceClientError(message):InferenceClientError

参数

名称 类型
消息 字符串

返回

InferenceClientError

覆盖

Error.constructor

定义于

inference/src/errors.ts:7

属性

原因

可选 cause: unknown

继承自

Error.cause

定义于

doc-internal/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26


消息

messagestring

继承自

Error.message

定义于

doc-internal/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts:1077


名称

namestring

继承自

Error.name

定义于

doc-internal/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts:1076


堆栈

可选 stack: string

继承自

Error.stack

定义于

doc-internal/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts:1078


prepareStackTrace

静态 可选 prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any

用于格式化堆栈跟踪的可选重写

请参阅

https://v8.node.org.cn/docs/stack-trace-api#customizing-stack-traces

类型声明

▸ (err, stackTraces):any

参数
名称 类型
错误 错误
堆栈跟踪 CallSite[]
返回

任何

继承自

Error.prepareStackTrace

定义于

inference/node_modules/.pnpm/@types+node@18.13.0/node_modules/@types/node/globals.d.ts:11


stackTraceLimit

静态 stackTraceLimit: number

继承自

Error.stackTraceLimit

定义于

inference/node_modules/.pnpm/@types+node@18.13.0/node_modules/@types/node/globals.d.ts:13

方法

captureStackTrace

captureStackTrace(targetObject, constructorOpt?):void

在目标对象上创建 .stack 属性

参数

名称 类型
目标对象 对象
constructorOpt? 函数

返回

继承自

Error.captureStackTrace

定义于

inference/node_modules/.pnpm/@types+node@18.13.0/node_modules/@types/node/globals.d.ts:4

< > 在 GitHub 上更新