@overmap-ai/core 1.0.35-fix-token-refresh-loop.0 → 1.0.35-fix-token-refresh-loop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/overmap-core.js
CHANGED
|
@@ -3465,6 +3465,19 @@ function extractErrorMessage(errorRes, err) {
|
|
|
3465
3465
|
return errorRes.body.error;
|
|
3466
3466
|
if (typeof errorRes.body.message === "string")
|
|
3467
3467
|
return errorRes.body.message;
|
|
3468
|
+
try {
|
|
3469
|
+
return Object.entries(errorRes.body).map(([key, value]) => {
|
|
3470
|
+
if (typeof value === "string") {
|
|
3471
|
+
return `${key}: ${value}`;
|
|
3472
|
+
}
|
|
3473
|
+
if (Array.isArray(value)) {
|
|
3474
|
+
return value.map((v) => `${key}: ${v}`).join("\n");
|
|
3475
|
+
}
|
|
3476
|
+
return `${key}: ${JSON.stringify(value)}`;
|
|
3477
|
+
}).join("\n");
|
|
3478
|
+
} catch (e) {
|
|
3479
|
+
console.error("Failed to extract error message from response body", e);
|
|
3480
|
+
}
|
|
3468
3481
|
} else if (typeof errorRes.body === "string")
|
|
3469
3482
|
return errorRes.body;
|
|
3470
3483
|
} else if (errorRes == null ? void 0 : errorRes.text) {
|