Content-Length: 275242 | pFad | http://github.com/huggingface/huggingface.js/commit/474e4efcb6eb3cc4045bc85e74a9f4fe5e74908e

D6 FIX: adapt error message extractor to the new format (#1507) · huggingface/huggingface.js@474e4ef · GitHub
Skip to content

Commit 474e4ef

Browse files
frascuchonWauplin
andauthored
FIX: adapt error message extractor to the new format (#1507)
Recently, I've seen some chatCompletion errors rendered as "[object Object]". Doing some debugging, I see the returned error object does not contain `error` or `details` attributes, but `message` (See image attached). I've changed the codebase to support this attribute. <img width="1234" alt="Captura de pantalla 2025-06-02 a las 10 47 49" src="https://github.com/user-attachments/assets/cceeb418-1a9e-4729-8856-df50ba2224f2" /> Co-authored-by: Lucain <lucain@huggingface.co>
1 parent 6e5ac81 commit 474e4ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/inference/src/utils/request.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ export async function innerRequest<T>(
6565
{ requestId: response.headers.get("x-request-id") ?? "", status: response.status, body: output }
6666
);
6767
}
68-
if (typeof output.error === "string" || typeof output.detail === "string") {
68+
if (typeof output.error === "string" || typeof output.detail === "string" || typeof output.message === "string") {
6969
throw new InferenceClientProviderApiError(
70-
`Failed to perform inference: ${output.error ?? output.detail}`,
70+
`Failed to perform inference: ${output.error ?? output.detail ?? output.message}`,
7171
{
7272
url,
7373
method: info.method ?? "GET",

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/huggingface/huggingface.js/commit/474e4efcb6eb3cc4045bc85e74a9f4fe5e74908e

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy