Huggingface.js 文档

类别:InferenceClientProviderApiError

Hugging Face's logo
加入 Hugging Face 社区

并获得增强的文档体验

开始使用

类别:InferenceClientProviderApiError

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

继承

  • InferenceClientHttpRequestError

    InferenceClientProviderApiError

构造函数

构造函数

新 InferenceClientProviderApiError(message, httpRequest, httpResponse): InferenceClientProviderApiError

参数

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

返回

InferenceClientProviderApiError

重写

InferenceClientHttpRequestError.constructor

定义于

inference/src/errors.ts:58

属性

原因

可选 cause: unknown

继承自

InferenceClientHttpRequestError.cause

定义于

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


httpRequest

httpRequest: HttpRequest

继承自

InferenceClientHttpRequestError.httpRequest

定义于

inference/src/errors.ts:34


httpResponse

httpResponse: HttpResponse

继承自

InferenceClientHttpRequestError.httpResponse

定义于

inference/src/errors.ts:35


消息

消息: string

继承自

InferenceClientHttpRequestError.message

定义于

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


名称

名称: string

继承自

InferenceClientHttpRequestError.name

定义于

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


堆栈

可选 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 上更新