badmfck-api-server 4.1.27 → 4.1.28

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.
@@ -90,14 +90,14 @@ class MicroserviceClient extends BaseService_1.BaseService {
90
90
  await TimeframeService_1.TimeframeService.wait(attemptTimeout * attempt);
91
91
  continue;
92
92
  }
93
- return { ...DefaultErrors_1.default.EXTERNAL_SERVICE_ERROR, details: "Network connection lost after multiple retries, attempts: " + attempt };
93
+ return { ...DefaultErrors_1.default.EXTERNAL_SERVICE_ERROR, stack: [this.options.host, req], details: "Network connection lost after multiple retries, attempts: " + attempt };
94
94
  }
95
95
  if (!resp.ok) {
96
96
  console.log(`Microservice call error response:`, resp);
97
97
  const remoteError = resp.error?.error;
98
98
  if (DefaultErrors_1.ErrorUtils.isError(remoteError))
99
99
  return remoteError;
100
- return { ...DefaultErrors_1.default.BAD_REQUEST, stack: [resp.error], details: resp.details };
100
+ return { ...DefaultErrors_1.default.BAD_REQUEST, stack: [this.options.host, req, resp.error], details: resp.details };
101
101
  }
102
102
  const body = resp.data;
103
103
  const isAccepted = body?.error?.code === DefaultErrors_1.default.ACCEPTED.code || body?.code === DefaultErrors_1.default.ACCEPTED.code;
@@ -106,14 +106,14 @@ class MicroserviceClient extends BaseService_1.BaseService {
106
106
  await TimeframeService_1.TimeframeService.wait(attemptTimeout * attempt);
107
107
  continue;
108
108
  }
109
- return { ...DefaultErrors_1.default.EXTERNAL_SERVICE_ERROR, details: "Microservice processing timeout, attempts: " + attempt };
109
+ return { ...DefaultErrors_1.default.EXTERNAL_SERVICE_ERROR, stack: [this.options.host, req], details: "Microservice processing timeout, attempts: " + attempt };
110
110
  }
111
111
  if (body && typeof body === "object") {
112
112
  return "error" in body ? body.error : (body.data ?? null);
113
113
  }
114
114
  return body ?? null;
115
115
  }
116
- return { ...DefaultErrors_1.default.EXTERNAL_SERVICE_ERROR, details: "Unknown polling error" };
116
+ return { ...DefaultErrors_1.default.EXTERNAL_SERVICE_ERROR, stack: [this.options.host, req], details: "Unknown polling error" };
117
117
  }
118
118
  }
119
119
  exports.MicroserviceClient = MicroserviceClient;