Huggingface.js 文件
類:InferenceClientHubApiError
並獲得增強的文件體驗
開始使用
類:InferenceClientHubApiError
當對 Hub 的 HTTP 請求失敗時丟擲,例如由於 API 問題或伺服器錯誤。
繼承關係
InferenceClientHttpRequestError
↳
InferenceClientHubApiError
建構函式
constructor
• new InferenceClientHubApiError(message
, httpRequest
, httpResponse
):InferenceClientHubApiError
引數
名稱 | 型別 |
---|---|
訊息 | 字串 |
httpRequest | HttpRequest |
httpResponse | HttpResponse |
返回
覆蓋
InferenceClientHttpRequestError.constructor
定義於
屬性
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
• httpRequest:HttpRequest
繼承自
InferenceClientHttpRequestError.httpRequest
定義於
httpResponse
• httpResponse:HttpResponse
繼承自
InferenceClientHttpRequestError.httpResponse
定義於
message
• message:string
繼承自
InferenceClientHttpRequestError.message
定義於
doc-internal/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts:1077
name
• name:string
繼承自
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.dev/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 上更新