@overmap-ai/core 1.0.65-error-message-fix.1 → 1.0.65-error-message-fix.3

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.
@@ -233,6 +233,7 @@ function extractErrorMessage(errorRes, err) {
233
233
  let ret;
234
234
  if (errorRes == null ? void 0 : errorRes.body) {
235
235
  if (typeof errorRes.body === "object") {
236
+ console.debug("error body is object", errorRes.body);
236
237
  const responseBody = errorRes.body;
237
238
  if (typeof responseBody.error === "string") {
238
239
  console.debug("body.error is string", responseBody.error);
@@ -240,9 +241,9 @@ function extractErrorMessage(errorRes, err) {
240
241
  } else if (typeof responseBody.message === "string") {
241
242
  console.debug("body.message is string", responseBody.message);
242
243
  ret = responseBody.message;
243
- } else if (responseBody.body) {
244
+ } else {
244
245
  try {
245
- ret = Object.entries(responseBody.body).map(([key, value]) => {
246
+ ret = Object.entries(responseBody).map(([key, value]) => {
246
247
  if (typeof value === "string") {
247
248
  if (_SPECIAL_KEYS.includes(key))
248
249
  return value;