Huggingface.js 文档

类:InferenceClientHubApiError

Hugging Face's logo
加入 Hugging Face 社区

并获得增强的文档体验

开始使用

类:InferenceClientHubApiError

当对 Hub 的 HTTP 请求失败时抛出,例如由于 API 问题或服务器错误。

继承关系

  • InferenceClientHttpRequestError

    InferenceClientHubApiError

构造函数

constructor

new InferenceClientHubApiError(message, httpRequest, httpResponse):InferenceClientHubApiError

参数

名称 类型
消息 字符串
httpRequest HttpRequest
httpResponse HttpResponse

返回

InferenceClientHubApiError

覆盖

InferenceClientHttpRequestError.constructor

定义于

inference/src/errors.ts:68

属性

cause

可选 cause: unknown

继承自

InferenceClientHttpRequestError.cause

定义于

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


httpRequest

httpRequestHttpRequest

继承自

InferenceClientHttpRequestError.httpRequest

定义于

inference/src/errors.ts:34


httpResponse

httpResponseHttpResponse

继承自

InferenceClientHttpRequestError.httpResponse

定义于

inference/src/errors.ts:35


message

messagestring

继承自

InferenceClientHttpRequestError.message

定义于

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


name

namestring

继承自

InferenceClientHttpRequestError.name

定义于

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


stack

可选 stack: string

继承自

InferenceClientHttpRequestError.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[]
返回

任何

继承自

InferenceClientHttpRequestError.prepareStackTrace

定义于

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


stackTraceLimit

静态 stackTraceLimit: number

继承自

InferenceClientHttpRequestError.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? 函数

返回

继承自

InferenceClientHttpRequestError.captureStackTrace

定义于

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

< > 在 GitHub 上更新