badmfck-api-server 3.5.1 → 3.5.2
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.
@@ -302,9 +302,7 @@ class APIService extends BaseService_1.BaseService {
|
|
302
302
|
result = await i.__execute(httpRequest);
|
303
303
|
}
|
304
304
|
catch (e) {
|
305
|
-
|
306
|
-
if (this.options.onError)
|
307
|
-
this.options.onError(e);
|
305
|
+
(0, LogService_1.logCrit)('${APIService.js}', e);
|
308
306
|
let data = {
|
309
307
|
error: {
|
310
308
|
code: 10002,
|
@@ -338,7 +336,7 @@ class APIService extends BaseService_1.BaseService {
|
|
338
336
|
}, tme, req.path);
|
339
337
|
});
|
340
338
|
server.listen(this.options.port, () => {
|
341
|
-
(0, LogService_1.
|
339
|
+
(0, LogService_1.logAPI)('${APIService.js}', 'API Service started at: ' + this.options.port + ", with base endpoint:" + this.options.baseEndPoint + ", ver.: " + this.version);
|
342
340
|
});
|
343
341
|
}
|
344
342
|
async sendResponse(ref, res, data, requestTime, endpoint, log, req) {
|
@@ -93,6 +93,12 @@ class LogService extends BaseService_1.BaseService {
|
|
93
93
|
this.checkTextLimit();
|
94
94
|
}
|
95
95
|
async init() {
|
96
|
+
process.on('uncaughtException', (err) => {
|
97
|
+
(0, exports.logError)("uncaughtException", err);
|
98
|
+
});
|
99
|
+
process.on('unhandledRejection', (err) => {
|
100
|
+
(0, exports.logError)("unhandledRejection", err);
|
101
|
+
});
|
96
102
|
exports.REQ_LOG_UNIQUE_SERVICES.listener = async () => {
|
97
103
|
const arr = [];
|
98
104
|
for (let i of this.uniqueServices)
|