@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.
@@ -4547,7 +4547,20 @@ class BaseApiService {
4547
4547
  }
4548
4548
  };
4549
4549
  const errorHandler = (error2) => {
4550
- error2.options.discard = true;
4550
+ if (error2 instanceof APIError) {
4551
+ error2.options.discard = true;
4552
+ } else {
4553
+ console.error(
4554
+ "Received an unexpected error while processing a request:",
4555
+ error2,
4556
+ "\nConverting error to APIError and discarding."
4557
+ );
4558
+ error2 = new APIError({
4559
+ message: "An error occurred while processing the request.",
4560
+ innerError: error2,
4561
+ discard: true
4562
+ });
4563
+ }
4551
4564
  promise.reject(error2);
4552
4565
  };
4553
4566
  innerPromise.then(successOrUndefinedHandler, errorHandler);