@overmap-ai/core 1.0.49-fix-error-messaging.0 → 1.0.49-fix-error-messaging.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.
|
@@ -4538,7 +4538,20 @@ var __publicField = (obj, key, value) => {
|
|
|
4538
4538
|
}
|
|
4539
4539
|
};
|
|
4540
4540
|
const errorHandler = (error2) => {
|
|
4541
|
-
error2
|
|
4541
|
+
if (error2 instanceof APIError) {
|
|
4542
|
+
error2.options.discard = true;
|
|
4543
|
+
} else {
|
|
4544
|
+
console.error(
|
|
4545
|
+
"Received an unexpected error while processing a request:",
|
|
4546
|
+
error2,
|
|
4547
|
+
"\nConverting error to APIError and discarding."
|
|
4548
|
+
);
|
|
4549
|
+
error2 = new APIError({
|
|
4550
|
+
message: "An error occurred while processing the request.",
|
|
4551
|
+
innerError: error2,
|
|
4552
|
+
discard: true
|
|
4553
|
+
});
|
|
4554
|
+
}
|
|
4542
4555
|
promise.reject(error2);
|
|
4543
4556
|
};
|
|
4544
4557
|
innerPromise.then(successOrUndefinedHandler, errorHandler);
|