badmfck-api-server 3.6.2 → 3.6.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.
- package/dist/apiServer/APIService.js +16 -1
- package/package.json +1 -1
@@ -303,7 +303,20 @@ class APIService extends BaseService_1.BaseService {
|
|
303
303
|
result = await i.__execute(httpRequest);
|
304
304
|
}
|
305
305
|
catch (e) {
|
306
|
-
|
306
|
+
console.error(e);
|
307
|
+
let stack = "";
|
308
|
+
let message = "";
|
309
|
+
if (e instanceof Error) {
|
310
|
+
stack = e.stack ?? "no-stack";
|
311
|
+
message = e.message;
|
312
|
+
(0, LogService_1.logCrit)('${APIService.js}', JSON.stringify({
|
313
|
+
stack: stack,
|
314
|
+
message: message
|
315
|
+
}));
|
316
|
+
}
|
317
|
+
if (DefaultErrors_1.ErrorUtils.isError(e)) {
|
318
|
+
(0, LogService_1.logCrit)('${APIService.js}', JSON.stringify(e));
|
319
|
+
}
|
307
320
|
let data = {
|
308
321
|
error: {
|
309
322
|
code: 10002,
|
@@ -371,6 +384,8 @@ class APIService extends BaseService_1.BaseService {
|
|
371
384
|
if (res.destroyed || res.closed) {
|
372
385
|
if (log)
|
373
386
|
log.error = "Connection already closed, can't send response for: " + data.endpoint;
|
387
|
+
if (this.options.onError)
|
388
|
+
this.options.onError("Connection already closed, can't send response: " + data.endpoint, data);
|
374
389
|
}
|
375
390
|
else {
|
376
391
|
try {
|