opticore-catch-exception-error 1.0.13 → 1.0.14
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/index.cjs +416 -137
- package/dist/index.d.cts +244 -46
- package/dist/index.d.ts +244 -46
- package/dist/index.js +389 -136
- package/dist/utils/translations/message.translation.en.json +58 -0
- package/dist/utils/translations/message.translation.fr.json +58 -0
- package/package.json +6 -5
package/dist/index.cjs
CHANGED
|
@@ -35,8 +35,32 @@ __export(index_exports, {
|
|
|
35
35
|
CEventNameError: () => CEventNameError,
|
|
36
36
|
ServerListenEventError: () => ServerListenEventError,
|
|
37
37
|
StackTraceAssertionError: () => StackTraceAssertionError,
|
|
38
|
+
StackTraceBeforeExit: () => StackTraceBeforeExit,
|
|
39
|
+
StackTraceEACCES: () => StackTraceEACCES,
|
|
40
|
+
StackTraceEADDRINUSE: () => StackTraceEADDRINUSE,
|
|
41
|
+
StackTraceECONNREFUSED: () => StackTraceECONNREFUSED,
|
|
42
|
+
StackTraceECONNRESET: () => StackTraceECONNRESET,
|
|
43
|
+
StackTraceEEXIST: () => StackTraceEEXIST,
|
|
44
|
+
StackTraceEISDIR: () => StackTraceEISDIR,
|
|
45
|
+
StackTraceEMFILE: () => StackTraceEMFILE,
|
|
46
|
+
StackTraceENOENT: () => StackTraceENOENT,
|
|
47
|
+
StackTraceENOTDIR: () => StackTraceENOTDIR,
|
|
48
|
+
StackTraceENOTEMPTY: () => StackTraceENOTEMPTY,
|
|
49
|
+
StackTraceEPERM: () => StackTraceEPERM,
|
|
50
|
+
StackTraceEPIPE: () => StackTraceEPIPE,
|
|
51
|
+
StackTraceERR_HTTP_HEADERS_SENT: () => StackTraceERR_HTTP_HEADERS_SENT,
|
|
52
|
+
StackTraceERR_INVALID_ARG_TYPE: () => StackTraceERR_INVALID_ARG_TYPE,
|
|
53
|
+
StackTraceERR_INVALID_CALLBACK: () => StackTraceERR_INVALID_CALLBACK,
|
|
54
|
+
StackTraceERR_OSSL_BAD_DECRYPT: () => StackTraceERR_OSSL_BAD_DECRYPT,
|
|
55
|
+
StackTraceERR_OSSL_EVP_UNSUPPORTED: () => StackTraceERR_OSSL_EVP_UNSUPPORTED,
|
|
56
|
+
StackTraceERR_OSSL_WRONG_FINAL_BLOCK_LENGTH: () => StackTraceERR_OSSL_WRONG_FINAL_BLOCK_LENGTH,
|
|
57
|
+
StackTraceERR_STREAM_DESTROYED: () => StackTraceERR_STREAM_DESTROYED,
|
|
58
|
+
StackTraceERR_TLS_CERT_ALTNAME_INVALID: () => StackTraceERR_TLS_CERT_ALTNAME_INVALID,
|
|
59
|
+
StackTraceERR_UNSUPPORTED_ESM_URL_SCHEME: () => StackTraceERR_UNSUPPORTED_ESM_URL_SCHEME,
|
|
60
|
+
StackTraceETIMEDOUT: () => StackTraceETIMEDOUT,
|
|
38
61
|
StackTraceError: () => StackTraceError,
|
|
39
62
|
StackTraceEvalError: () => StackTraceEvalError,
|
|
63
|
+
StackTraceExit: () => StackTraceExit,
|
|
40
64
|
StackTraceGeneralError: () => StackTraceGeneralError,
|
|
41
65
|
StackTraceOpenSSLError: () => StackTraceOpenSSLError,
|
|
42
66
|
StackTraceRangeError: () => StackTraceRangeError,
|
|
@@ -44,7 +68,9 @@ __export(index_exports, {
|
|
|
44
68
|
StackTraceSyntaxError: () => StackTraceSyntaxError,
|
|
45
69
|
StackTraceSystemError: () => StackTraceSystemError,
|
|
46
70
|
StackTraceTypeError: () => StackTraceTypeError,
|
|
47
|
-
StackTraceURIError: () => StackTraceURIError
|
|
71
|
+
StackTraceURIError: () => StackTraceURIError,
|
|
72
|
+
StackTraceUncaughtException: () => StackTraceUncaughtException,
|
|
73
|
+
StackTraceUnhandledRejection: () => StackTraceUnhandledRejection
|
|
48
74
|
});
|
|
49
75
|
module.exports = __toCommonJS(index_exports);
|
|
50
76
|
|
|
@@ -54,16 +80,43 @@ var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
|
54
80
|
|
|
55
81
|
// src/domains/constants/errorName.constant.ts
|
|
56
82
|
var CErrorName = {
|
|
83
|
+
assertionError: "AssertionError",
|
|
84
|
+
beforeExit: "beforeExit",
|
|
85
|
+
eacces: "EACCES",
|
|
86
|
+
eaddrinuse: "EADDRINUSE",
|
|
87
|
+
econnrefused: "ECONNREFUSED",
|
|
88
|
+
econnreset: "ECONNRESET",
|
|
89
|
+
eexist: "EEXIST",
|
|
90
|
+
error: "Error",
|
|
91
|
+
eisdir: "EISDIR",
|
|
92
|
+
emfile: "EMFILE",
|
|
93
|
+
enoent: "ENOENT",
|
|
94
|
+
enotdir: "ENOTDIR",
|
|
95
|
+
enotEmpty: "ENOTEMPTY",
|
|
96
|
+
eperm: "EPERM",
|
|
97
|
+
epipe: "EPIPE",
|
|
98
|
+
etimedout: "ETIMEDOUT",
|
|
57
99
|
evalError: "EvalError",
|
|
58
|
-
|
|
100
|
+
errOsslEvpUnsupported: "ERR_OSSL_EVP_UNSUPPORTED",
|
|
101
|
+
errOsslBadDecrypt: "ERR_OSSL_BAD_DECRYPT",
|
|
102
|
+
errOsslWrongFinalBlockLength: "ERR_OSSL_WRONG_FINAL_BLOCK_LENGTH",
|
|
103
|
+
errInvalidArgType: "ERR_INVALID_ARG_TYPE",
|
|
104
|
+
errInvalidCallback: "ERR_INVALID_CALLBACK",
|
|
105
|
+
errHttpHeadersSent: "ERR_HTTP_HEADERS_SENT",
|
|
106
|
+
errStreamDestroyed: "ERR_STREAM_DESTROYED",
|
|
107
|
+
errTlsCertAltnameInvalid: "ERR_TLS_CERT_ALTNAME_INVALID",
|
|
108
|
+
errUnsupportedEsmUrlScheme: "ERR_UNSUPPORTED_ESM_URL_SCHEME",
|
|
109
|
+
exit: "exit",
|
|
110
|
+
generalError: "GeneralError",
|
|
111
|
+
openSSLError: "OpenSSLError",
|
|
59
112
|
rangeError: "RangeError",
|
|
60
113
|
referenceError: "ReferenceError",
|
|
114
|
+
systemError: "SystemError",
|
|
115
|
+
syntaxError: "SyntaxError",
|
|
61
116
|
typeError: "TypeError",
|
|
62
117
|
uriError: "URIError",
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
openSSLError: "OpenSSLError",
|
|
66
|
-
generalError: "GeneralError"
|
|
118
|
+
uncaughtException: "uncaughtException",
|
|
119
|
+
unhandledRejection: "unhandledRejection"
|
|
67
120
|
};
|
|
68
121
|
|
|
69
122
|
// src/domains/constants/event.constant.ts
|
|
@@ -119,7 +172,7 @@ var StackTraceError = class extends Error {
|
|
|
119
172
|
var import_opticore_http_response = require("opticore-http-response");
|
|
120
173
|
var StackTraceAssertionError = class extends StackTraceError {
|
|
121
174
|
constructor(message) {
|
|
122
|
-
super(message, CErrorName.
|
|
175
|
+
super(message, CErrorName.assertionError, import_opticore_http_response.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
123
176
|
}
|
|
124
177
|
};
|
|
125
178
|
|
|
@@ -135,7 +188,7 @@ var StackTraceEvalError = class extends StackTraceError {
|
|
|
135
188
|
var import_opticore_http_response3 = require("opticore-http-response");
|
|
136
189
|
var StackTraceGeneralError = class extends StackTraceError {
|
|
137
190
|
constructor(message) {
|
|
138
|
-
super(message, CErrorName.
|
|
191
|
+
super(message, CErrorName.generalError, import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR, false);
|
|
139
192
|
}
|
|
140
193
|
};
|
|
141
194
|
|
|
@@ -143,7 +196,7 @@ var StackTraceGeneralError = class extends StackTraceError {
|
|
|
143
196
|
var import_opticore_http_response4 = require("opticore-http-response");
|
|
144
197
|
var StackTraceOpenSSLError = class extends StackTraceError {
|
|
145
198
|
constructor(message) {
|
|
146
|
-
super(message, CErrorName.
|
|
199
|
+
super(message, CErrorName.openSSLError, import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR, false);
|
|
147
200
|
}
|
|
148
201
|
};
|
|
149
202
|
|
|
@@ -151,7 +204,7 @@ var StackTraceOpenSSLError = class extends StackTraceError {
|
|
|
151
204
|
var import_opticore_http_response5 = require("opticore-http-response");
|
|
152
205
|
var StackTraceRangeError = class extends StackTraceError {
|
|
153
206
|
constructor(message) {
|
|
154
|
-
super(message, CErrorName.
|
|
207
|
+
super(message, CErrorName.rangeError, import_opticore_http_response5.HttpStatusCode.BAD_REQUEST, true);
|
|
155
208
|
}
|
|
156
209
|
};
|
|
157
210
|
|
|
@@ -159,7 +212,7 @@ var StackTraceRangeError = class extends StackTraceError {
|
|
|
159
212
|
var import_opticore_http_response6 = require("opticore-http-response");
|
|
160
213
|
var StackTraceReferenceError = class extends StackTraceError {
|
|
161
214
|
constructor(message) {
|
|
162
|
-
super(message, CErrorName.
|
|
215
|
+
super(message, CErrorName.referenceError, import_opticore_http_response6.HttpStatusCode.BAD_REQUEST, true);
|
|
163
216
|
}
|
|
164
217
|
};
|
|
165
218
|
|
|
@@ -167,7 +220,7 @@ var StackTraceReferenceError = class extends StackTraceError {
|
|
|
167
220
|
var import_opticore_http_response7 = require("opticore-http-response");
|
|
168
221
|
var StackTraceSyntaxError = class extends StackTraceError {
|
|
169
222
|
constructor(message) {
|
|
170
|
-
super(message, CErrorName.
|
|
223
|
+
super(message, CErrorName.syntaxError, import_opticore_http_response7.HttpStatusCode.BAD_REQUEST, true);
|
|
171
224
|
}
|
|
172
225
|
};
|
|
173
226
|
|
|
@@ -184,7 +237,7 @@ var StackTraceSystemError = class extends StackTraceError {
|
|
|
184
237
|
var import_opticore_http_response9 = require("opticore-http-response");
|
|
185
238
|
var StackTraceTypeError = class extends StackTraceError {
|
|
186
239
|
constructor(message) {
|
|
187
|
-
super(message, CErrorName.
|
|
240
|
+
super(message, CErrorName.typeError, import_opticore_http_response9.HttpStatusCode.BAD_REQUEST, true);
|
|
188
241
|
}
|
|
189
242
|
};
|
|
190
243
|
|
|
@@ -192,7 +245,7 @@ var StackTraceTypeError = class extends StackTraceError {
|
|
|
192
245
|
var import_opticore_http_response10 = require("opticore-http-response");
|
|
193
246
|
var StackTraceURIError = class extends StackTraceError {
|
|
194
247
|
constructor(message) {
|
|
195
|
-
super(message, CErrorName.
|
|
248
|
+
super(message, CErrorName.uriError, import_opticore_http_response10.HttpStatusCode.BAD_REQUEST, true);
|
|
196
249
|
}
|
|
197
250
|
};
|
|
198
251
|
|
|
@@ -220,47 +273,46 @@ var translateCatchExceptionErrorLanguageLoader = (defaultLocalLang) => {
|
|
|
220
273
|
|
|
221
274
|
// src/core/errors/events/serverListen.event.error.ts
|
|
222
275
|
var ServerListenEventError = class {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
276
|
+
logger = new import_opticore_logger.LoggerCore();
|
|
277
|
+
stackTrace;
|
|
278
|
+
localeLanguage;
|
|
279
|
+
constructor(defaultLocalLang) {
|
|
280
|
+
this.localeLanguage = defaultLocalLang;
|
|
226
281
|
translateCatchExceptionErrorLanguageLoader(defaultLocalLang);
|
|
227
|
-
return this;
|
|
228
282
|
}
|
|
229
283
|
/**
|
|
230
|
-
*
|
|
231
|
-
* @param defaultLocalLang
|
|
232
284
|
* @param appPort
|
|
285
|
+
*
|
|
233
286
|
*/
|
|
234
|
-
|
|
287
|
+
hostPortUndefined(appPort) {
|
|
235
288
|
this.stackTrace = this.traceError(
|
|
236
|
-
import_opticore_translator2.TranslationLoader.t("errorHostUrl",
|
|
237
|
-
import_opticore_translator2.TranslationLoader.t("listening",
|
|
289
|
+
import_opticore_translator2.TranslationLoader.t("errorHostUrl", this.localeLanguage),
|
|
290
|
+
import_opticore_translator2.TranslationLoader.t("listening", this.localeLanguage),
|
|
238
291
|
import_opticore_http_response11.HttpStatusCode.BAD_REQUEST
|
|
239
292
|
);
|
|
240
293
|
this.logger.error(
|
|
241
294
|
this.stackTrace.message,
|
|
242
|
-
import_opticore_translator2.TranslationLoader.t("webServer",
|
|
243
|
-
import_opticore_translator2.TranslationLoader.t("badPort",
|
|
295
|
+
import_opticore_translator2.TranslationLoader.t("webServer", this.localeLanguage),
|
|
296
|
+
import_opticore_translator2.TranslationLoader.t("badPort", this.localeLanguage, { badPort: appPort }),
|
|
244
297
|
this.stackTrace.stack,
|
|
245
298
|
import_opticore_http_response11.HttpStatusCode.BAD_REQUEST
|
|
246
299
|
);
|
|
247
300
|
import_process.default.exit();
|
|
248
301
|
}
|
|
249
302
|
/**
|
|
250
|
-
*
|
|
251
|
-
* @param defaultLocalLang
|
|
252
303
|
* @param appHost
|
|
304
|
+
*
|
|
253
305
|
*/
|
|
254
|
-
|
|
306
|
+
hostUndefined(appHost) {
|
|
255
307
|
this.stackTrace = this.traceError(
|
|
256
|
-
import_opticore_translator2.TranslationLoader.t("badHost",
|
|
257
|
-
import_opticore_translator2.TranslationLoader.t("listening",
|
|
308
|
+
import_opticore_translator2.TranslationLoader.t("badHost", this.localeLanguage, { badHost: appHost }),
|
|
309
|
+
import_opticore_translator2.TranslationLoader.t("listening", this.localeLanguage),
|
|
258
310
|
import_opticore_http_response11.HttpStatusCode.BAD_REQUEST
|
|
259
311
|
);
|
|
260
312
|
this.logger.error(
|
|
261
313
|
this.stackTrace.message,
|
|
262
|
-
import_opticore_translator2.TranslationLoader.t("webServer",
|
|
263
|
-
import_opticore_translator2.TranslationLoader.t("badHost",
|
|
314
|
+
import_opticore_translator2.TranslationLoader.t("webServer", this.localeLanguage),
|
|
315
|
+
import_opticore_translator2.TranslationLoader.t("badHost", this.localeLanguage),
|
|
264
316
|
this.stackTrace.stack,
|
|
265
317
|
import_opticore_http_response11.HttpStatusCode.BAD_REQUEST
|
|
266
318
|
);
|
|
@@ -269,31 +321,30 @@ var ServerListenEventError = class {
|
|
|
269
321
|
/**
|
|
270
322
|
*
|
|
271
323
|
*/
|
|
272
|
-
|
|
324
|
+
portUndefined() {
|
|
273
325
|
this.stackTrace = this.traceError(
|
|
274
|
-
import_opticore_translator2.TranslationLoader.t("badPort",
|
|
275
|
-
import_opticore_translator2.TranslationLoader.t("listening",
|
|
326
|
+
import_opticore_translator2.TranslationLoader.t("badPort", this.localeLanguage),
|
|
327
|
+
import_opticore_translator2.TranslationLoader.t("listening", this.localeLanguage),
|
|
276
328
|
import_opticore_http_response11.HttpStatusCode.BAD_REQUEST
|
|
277
329
|
);
|
|
278
330
|
this.logger.error(
|
|
279
331
|
this.stackTrace.message,
|
|
280
|
-
import_opticore_translator2.TranslationLoader.t("webServer",
|
|
281
|
-
import_opticore_translator2.TranslationLoader.t("badHost",
|
|
332
|
+
import_opticore_translator2.TranslationLoader.t("webServer", this.localeLanguage),
|
|
333
|
+
import_opticore_translator2.TranslationLoader.t("badHost", this.localeLanguage),
|
|
282
334
|
this.stackTrace.stack,
|
|
283
335
|
import_opticore_http_response11.HttpStatusCode.BAD_REQUEST
|
|
284
336
|
);
|
|
285
337
|
import_process.default.exit();
|
|
286
338
|
}
|
|
287
339
|
/**
|
|
288
|
-
*
|
|
289
340
|
* @param err
|
|
290
|
-
*
|
|
341
|
+
*
|
|
291
342
|
*/
|
|
292
|
-
|
|
343
|
+
onEventError(err) {
|
|
293
344
|
this.logger.error(
|
|
294
|
-
import_opticore_translator2.TranslationLoader.t(err.message,
|
|
295
|
-
import_opticore_translator2.TranslationLoader.t("serverStart",
|
|
296
|
-
import_opticore_translator2.TranslationLoader.t("serverStartError",
|
|
345
|
+
import_opticore_translator2.TranslationLoader.t(err.message, this.localeLanguage),
|
|
346
|
+
import_opticore_translator2.TranslationLoader.t("serverStart", this.localeLanguage),
|
|
347
|
+
import_opticore_translator2.TranslationLoader.t("serverStartError", this.localeLanguage, { err }),
|
|
297
348
|
err.stack,
|
|
298
349
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
299
350
|
);
|
|
@@ -302,7 +353,7 @@ var ServerListenEventError = class {
|
|
|
302
353
|
*
|
|
303
354
|
* @param error
|
|
304
355
|
*/
|
|
305
|
-
|
|
356
|
+
listenerError(error) {
|
|
306
357
|
this.stackTrace = this.traceError(
|
|
307
358
|
error.message,
|
|
308
359
|
error.name,
|
|
@@ -317,20 +368,19 @@ var ServerListenEventError = class {
|
|
|
317
368
|
);
|
|
318
369
|
}
|
|
319
370
|
/**
|
|
320
|
-
*
|
|
321
371
|
* @param code
|
|
322
|
-
*
|
|
372
|
+
*
|
|
323
373
|
*/
|
|
324
|
-
|
|
374
|
+
processBeforeExit(code) {
|
|
325
375
|
this.stackTrace = this.traceError(
|
|
326
|
-
import_opticore_translator2.TranslationLoader.t("processExitCode",
|
|
327
|
-
import_opticore_translator2.TranslationLoader.t("beforeExit",
|
|
376
|
+
import_opticore_translator2.TranslationLoader.t("processExitCode", this.localeLanguage, { processExitCode: code }),
|
|
377
|
+
import_opticore_translator2.TranslationLoader.t("beforeExit", this.localeLanguage),
|
|
328
378
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
329
379
|
);
|
|
330
380
|
this.logger.error(
|
|
331
381
|
this.stackTrace.message,
|
|
332
|
-
import_opticore_translator2.TranslationLoader.t("beforeExit",
|
|
333
|
-
import_opticore_translator2.TranslationLoader.t("processBeforeExit",
|
|
382
|
+
import_opticore_translator2.TranslationLoader.t("beforeExit", this.localeLanguage),
|
|
383
|
+
import_opticore_translator2.TranslationLoader.t("processBeforeExit", this.localeLanguage),
|
|
334
384
|
this.stackTrace.stack,
|
|
335
385
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
336
386
|
);
|
|
@@ -339,16 +389,16 @@ var ServerListenEventError = class {
|
|
|
339
389
|
/**
|
|
340
390
|
*
|
|
341
391
|
*/
|
|
342
|
-
|
|
392
|
+
processDisconnected() {
|
|
343
393
|
this.stackTrace = this.traceError(
|
|
344
|
-
import_opticore_translator2.TranslationLoader.t("childProcessDiscon",
|
|
345
|
-
import_opticore_translator2.TranslationLoader.t("processDiscon",
|
|
394
|
+
import_opticore_translator2.TranslationLoader.t("childProcessDiscon", this.localeLanguage),
|
|
395
|
+
import_opticore_translator2.TranslationLoader.t("processDiscon", this.localeLanguage),
|
|
346
396
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
347
397
|
);
|
|
348
398
|
this.logger.error(
|
|
349
399
|
this.stackTrace.message,
|
|
350
|
-
import_opticore_translator2.TranslationLoader.t("disconnected",
|
|
351
|
-
import_opticore_translator2.TranslationLoader.t("processDiscon",
|
|
400
|
+
import_opticore_translator2.TranslationLoader.t("disconnected", this.localeLanguage),
|
|
401
|
+
import_opticore_translator2.TranslationLoader.t("processDiscon", this.localeLanguage),
|
|
352
402
|
this.stackTrace.stack,
|
|
353
403
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
354
404
|
);
|
|
@@ -357,31 +407,30 @@ var ServerListenEventError = class {
|
|
|
357
407
|
/**
|
|
358
408
|
*
|
|
359
409
|
* @param code
|
|
360
|
-
* @param defaultLocalLang
|
|
361
410
|
*/
|
|
362
|
-
|
|
411
|
+
exited(code) {
|
|
363
412
|
switch (code) {
|
|
364
413
|
case 0:
|
|
365
414
|
this.logger.success(
|
|
366
|
-
import_opticore_translator2.TranslationLoader.t("completed",
|
|
367
|
-
import_opticore_translator2.TranslationLoader.t("finishingProcessWell",
|
|
415
|
+
import_opticore_translator2.TranslationLoader.t("completed", this.localeLanguage, { code }),
|
|
416
|
+
import_opticore_translator2.TranslationLoader.t("finishingProcessWell", this.localeLanguage, { code })
|
|
368
417
|
);
|
|
369
418
|
console.log("");
|
|
370
419
|
const paddingLength = 35;
|
|
371
420
|
const msg0 = " ".padEnd(paddingLength, " ");
|
|
372
421
|
console.log(import_chalk.default.bgGreen.white(msg0.padEnd(paddingLength, " ")));
|
|
373
|
-
console.log(`${import_ansi_colors.default.bgGreen(` ${import_opticore_translator2.TranslationLoader.t("serverStopped",
|
|
422
|
+
console.log(`${import_ansi_colors.default.bgGreen(` ${import_opticore_translator2.TranslationLoader.t("serverStopped", this.localeLanguage)} `)}`);
|
|
374
423
|
console.log(import_chalk.default.bgGreen.white(msg0.padEnd(paddingLength, " ")));
|
|
375
424
|
break;
|
|
376
425
|
case 1:
|
|
377
426
|
this.stackTrace = this.traceError(
|
|
378
|
-
import_opticore_translator2.TranslationLoader.t("somethingWentWrong",
|
|
379
|
-
import_opticore_translator2.TranslationLoader.t("genErrors",
|
|
427
|
+
import_opticore_translator2.TranslationLoader.t("somethingWentWrong", this.localeLanguage),
|
|
428
|
+
import_opticore_translator2.TranslationLoader.t("genErrors", this.localeLanguage),
|
|
380
429
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
381
430
|
);
|
|
382
431
|
this.logger.error(
|
|
383
432
|
this.stackTrace.message,
|
|
384
|
-
import_opticore_translator2.TranslationLoader.t("exited",
|
|
433
|
+
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
385
434
|
"General Errors",
|
|
386
435
|
this.stackTrace.stack,
|
|
387
436
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
@@ -389,27 +438,27 @@ var ServerListenEventError = class {
|
|
|
389
438
|
break;
|
|
390
439
|
case 2:
|
|
391
440
|
this.stackTrace = this.traceError(
|
|
392
|
-
import_opticore_translator2.TranslationLoader.t("incorrectCmd",
|
|
393
|
-
import_opticore_translator2.TranslationLoader.t("misuseShell",
|
|
441
|
+
import_opticore_translator2.TranslationLoader.t("incorrectCmd", this.localeLanguage),
|
|
442
|
+
import_opticore_translator2.TranslationLoader.t("misuseShell", this.localeLanguage),
|
|
394
443
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
395
444
|
);
|
|
396
445
|
this.logger.error(
|
|
397
446
|
this.stackTrace.message,
|
|
398
|
-
import_opticore_translator2.TranslationLoader.t("exited",
|
|
399
|
-
import_opticore_translator2.TranslationLoader.t("incorrectCmd",
|
|
447
|
+
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
448
|
+
import_opticore_translator2.TranslationLoader.t("incorrectCmd", this.localeLanguage),
|
|
400
449
|
this.stackTrace.stack,
|
|
401
450
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
402
451
|
);
|
|
403
452
|
break;
|
|
404
453
|
case 126:
|
|
405
454
|
this.stackTrace = this.traceError(
|
|
406
|
-
import_opticore_translator2.TranslationLoader.t("incorrectCmd",
|
|
407
|
-
import_opticore_translator2.TranslationLoader.t("cmdNotExecutable",
|
|
455
|
+
import_opticore_translator2.TranslationLoader.t("incorrectCmd", this.localeLanguage),
|
|
456
|
+
import_opticore_translator2.TranslationLoader.t("cmdNotExecutable", this.localeLanguage),
|
|
408
457
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
409
458
|
);
|
|
410
459
|
this.logger.error(
|
|
411
460
|
this.stackTrace.message,
|
|
412
|
-
import_opticore_translator2.TranslationLoader.t("exited",
|
|
461
|
+
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
413
462
|
this.stackTrace.name,
|
|
414
463
|
this.stackTrace.stack,
|
|
415
464
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
@@ -417,13 +466,13 @@ var ServerListenEventError = class {
|
|
|
417
466
|
break;
|
|
418
467
|
case 127:
|
|
419
468
|
this.stackTrace = this.traceError(
|
|
420
|
-
import_opticore_translator2.TranslationLoader.t("cmdNotFound",
|
|
421
|
-
import_opticore_translator2.TranslationLoader.t("cmdNotFoundInSystemPath",
|
|
469
|
+
import_opticore_translator2.TranslationLoader.t("cmdNotFound", this.localeLanguage),
|
|
470
|
+
import_opticore_translator2.TranslationLoader.t("cmdNotFoundInSystemPath", this.localeLanguage),
|
|
422
471
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
423
472
|
);
|
|
424
473
|
this.logger.error(
|
|
425
474
|
this.stackTrace.message,
|
|
426
|
-
import_opticore_translator2.TranslationLoader.t("exited",
|
|
475
|
+
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
427
476
|
this.stackTrace.name,
|
|
428
477
|
this.stackTrace.stack,
|
|
429
478
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
@@ -431,13 +480,13 @@ var ServerListenEventError = class {
|
|
|
431
480
|
break;
|
|
432
481
|
case 128:
|
|
433
482
|
this.stackTrace = this.traceError(
|
|
434
|
-
import_opticore_translator2.TranslationLoader.t("cmdNotFoundInSystemPath",
|
|
435
|
-
import_opticore_translator2.TranslationLoader.t("argInvalid",
|
|
483
|
+
import_opticore_translator2.TranslationLoader.t("cmdNotFoundInSystemPath", this.localeLanguage),
|
|
484
|
+
import_opticore_translator2.TranslationLoader.t("argInvalid", this.localeLanguage),
|
|
436
485
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
437
486
|
);
|
|
438
487
|
this.logger.error(
|
|
439
488
|
this.stackTrace.message,
|
|
440
|
-
import_opticore_translator2.TranslationLoader.t("exited",
|
|
489
|
+
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
441
490
|
this.stackTrace.name,
|
|
442
491
|
this.stackTrace.stack,
|
|
443
492
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
@@ -445,13 +494,13 @@ var ServerListenEventError = class {
|
|
|
445
494
|
break;
|
|
446
495
|
case 130:
|
|
447
496
|
this.stackTrace = this.traceError(
|
|
448
|
-
import_opticore_translator2.TranslationLoader.t("scriptEndedManuallyByCtrlC",
|
|
449
|
-
import_opticore_translator2.TranslationLoader.t("scriptEnded",
|
|
497
|
+
import_opticore_translator2.TranslationLoader.t("scriptEndedManuallyByCtrlC", this.localeLanguage),
|
|
498
|
+
import_opticore_translator2.TranslationLoader.t("scriptEnded", this.localeLanguage),
|
|
450
499
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
451
500
|
);
|
|
452
501
|
this.logger.error(
|
|
453
502
|
this.stackTrace.message,
|
|
454
|
-
import_opticore_translator2.TranslationLoader.t("exited",
|
|
503
|
+
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
455
504
|
this.stackTrace.name,
|
|
456
505
|
this.stackTrace.stack,
|
|
457
506
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
@@ -459,13 +508,13 @@ var ServerListenEventError = class {
|
|
|
459
508
|
break;
|
|
460
509
|
case 137:
|
|
461
510
|
this.stackTrace = this.traceError(
|
|
462
|
-
import_opticore_translator2.TranslationLoader.t("processEndedBySIGKILL",
|
|
511
|
+
import_opticore_translator2.TranslationLoader.t("processEndedBySIGKILL", this.localeLanguage),
|
|
463
512
|
"SIGKILL",
|
|
464
513
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
465
514
|
);
|
|
466
515
|
this.logger.error(
|
|
467
516
|
this.stackTrace.message,
|
|
468
|
-
import_opticore_translator2.TranslationLoader.t("exited",
|
|
517
|
+
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
469
518
|
this.stackTrace.name,
|
|
470
519
|
this.stackTrace.stack,
|
|
471
520
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
@@ -473,13 +522,13 @@ var ServerListenEventError = class {
|
|
|
473
522
|
break;
|
|
474
523
|
case 139:
|
|
475
524
|
this.stackTrace = this.traceError(
|
|
476
|
-
import_opticore_translator2.TranslationLoader.t("accessProcessIllegally",
|
|
477
|
-
import_opticore_translator2.TranslationLoader.t("defaultSegment",
|
|
525
|
+
import_opticore_translator2.TranslationLoader.t("accessProcessIllegally", this.localeLanguage),
|
|
526
|
+
import_opticore_translator2.TranslationLoader.t("defaultSegment", this.localeLanguage),
|
|
478
527
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
479
528
|
);
|
|
480
529
|
this.logger.error(
|
|
481
530
|
this.stackTrace.message,
|
|
482
|
-
import_opticore_translator2.TranslationLoader.t("exited",
|
|
531
|
+
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
483
532
|
this.stackTrace.name,
|
|
484
533
|
this.stackTrace.stack,
|
|
485
534
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
@@ -487,13 +536,13 @@ var ServerListenEventError = class {
|
|
|
487
536
|
break;
|
|
488
537
|
case 143:
|
|
489
538
|
this.stackTrace = this.traceError(
|
|
490
|
-
import_opticore_translator2.TranslationLoader.t("processReceivedSigtermSignal",
|
|
491
|
-
import_opticore_translator2.TranslationLoader.t("processReceived",
|
|
539
|
+
import_opticore_translator2.TranslationLoader.t("processReceivedSigtermSignal", this.localeLanguage),
|
|
540
|
+
import_opticore_translator2.TranslationLoader.t("processReceived", this.localeLanguage),
|
|
492
541
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
493
542
|
);
|
|
494
543
|
this.logger.error(
|
|
495
544
|
this.stackTrace.message,
|
|
496
|
-
import_opticore_translator2.TranslationLoader.t("exited",
|
|
545
|
+
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
497
546
|
this.stackTrace.name,
|
|
498
547
|
this.stackTrace.stack,
|
|
499
548
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
@@ -501,13 +550,13 @@ var ServerListenEventError = class {
|
|
|
501
550
|
break;
|
|
502
551
|
case 255:
|
|
503
552
|
this.stackTrace = this.traceError(
|
|
504
|
-
import_opticore_translator2.TranslationLoader.t("exitCode",
|
|
505
|
-
import_opticore_translator2.TranslationLoader.t("outRange",
|
|
553
|
+
import_opticore_translator2.TranslationLoader.t("exitCode", this.localeLanguage),
|
|
554
|
+
import_opticore_translator2.TranslationLoader.t("outRange", this.localeLanguage),
|
|
506
555
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
507
556
|
);
|
|
508
557
|
this.logger.error(
|
|
509
558
|
this.stackTrace.message,
|
|
510
|
-
import_opticore_translator2.TranslationLoader.t("exited",
|
|
559
|
+
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
511
560
|
this.stackTrace.name,
|
|
512
561
|
this.stackTrace.stack,
|
|
513
562
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
@@ -515,13 +564,13 @@ var ServerListenEventError = class {
|
|
|
515
564
|
break;
|
|
516
565
|
default:
|
|
517
566
|
this.stackTrace = this.traceError(
|
|
518
|
-
import_opticore_translator2.TranslationLoader.t("errorOccurring",
|
|
519
|
-
import_opticore_translator2.TranslationLoader.t("errors",
|
|
567
|
+
import_opticore_translator2.TranslationLoader.t("errorOccurring", this.localeLanguage),
|
|
568
|
+
import_opticore_translator2.TranslationLoader.t("errors", this.localeLanguage),
|
|
520
569
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
521
570
|
);
|
|
522
571
|
this.logger.error(
|
|
523
572
|
this.stackTrace.message,
|
|
524
|
-
import_opticore_translator2.TranslationLoader.t("exited",
|
|
573
|
+
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
525
574
|
this.stackTrace.name,
|
|
526
575
|
this.stackTrace.stack,
|
|
527
576
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
@@ -532,13 +581,12 @@ var ServerListenEventError = class {
|
|
|
532
581
|
/**
|
|
533
582
|
*
|
|
534
583
|
* @param promise
|
|
535
|
-
* @param defaultLocalLang
|
|
536
584
|
*/
|
|
537
|
-
|
|
585
|
+
promiseRejectionHandled(promise) {
|
|
538
586
|
try {
|
|
539
587
|
this.stackTrace = this.traceError(
|
|
540
|
-
import_opticore_translator2.TranslationLoader.t("promise",
|
|
541
|
-
import_opticore_translator2.TranslationLoader.t("rejectionPromise",
|
|
588
|
+
import_opticore_translator2.TranslationLoader.t("promise", this.localeLanguage, { promise }),
|
|
589
|
+
import_opticore_translator2.TranslationLoader.t("rejectionPromise", this.localeLanguage, { promise }),
|
|
542
590
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
543
591
|
);
|
|
544
592
|
this.logger.error(
|
|
@@ -554,15 +602,14 @@ var ServerListenEventError = class {
|
|
|
554
602
|
/**
|
|
555
603
|
*
|
|
556
604
|
* @param error
|
|
557
|
-
* @param defaultLocalLang
|
|
558
605
|
*/
|
|
559
|
-
|
|
606
|
+
uncaughtException(error) {
|
|
560
607
|
if (error.message === "'app.router' is deprecated!\nPlease see the 3.x to 4.x migration guide for details on how to update your app.") {
|
|
561
608
|
console.log("");
|
|
562
609
|
} else {
|
|
563
610
|
this.stackTrace = this.traceError(
|
|
564
|
-
import_opticore_translator2.TranslationLoader.t(error.message,
|
|
565
|
-
import_opticore_translator2.TranslationLoader.t("uncaughtExceptionHandled",
|
|
611
|
+
import_opticore_translator2.TranslationLoader.t(error.message, this.localeLanguage, { error: error.stack }),
|
|
612
|
+
import_opticore_translator2.TranslationLoader.t("uncaughtExceptionHandled", this.localeLanguage),
|
|
566
613
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
567
614
|
);
|
|
568
615
|
this.logger.error(
|
|
@@ -578,7 +625,7 @@ var ServerListenEventError = class {
|
|
|
578
625
|
*
|
|
579
626
|
* @param error
|
|
580
627
|
*/
|
|
581
|
-
|
|
628
|
+
uncaughtExceptionMonitor(error) {
|
|
582
629
|
if (error.message === "'app.router' is deprecated!\nPlease see the 3.x to 4.x migration guide for details on how to update your app.") {
|
|
583
630
|
console.log("");
|
|
584
631
|
}
|
|
@@ -587,12 +634,11 @@ var ServerListenEventError = class {
|
|
|
587
634
|
*
|
|
588
635
|
* @param reason
|
|
589
636
|
* @param promise
|
|
590
|
-
* @param defaultLocalLang
|
|
591
637
|
*/
|
|
592
|
-
|
|
638
|
+
unhandledRejection(reason, promise) {
|
|
593
639
|
this.stackTrace = this.traceError(
|
|
594
|
-
import_opticore_translator2.TranslationLoader.t("unhandledRejectionAtPromise",
|
|
595
|
-
import_opticore_translator2.TranslationLoader.t("unhandledRejection",
|
|
640
|
+
import_opticore_translator2.TranslationLoader.t("unhandledRejectionAtPromise", this.localeLanguage, { promise, reason }),
|
|
641
|
+
import_opticore_translator2.TranslationLoader.t("unhandledRejection", this.localeLanguage, { promise, reason }),
|
|
596
642
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
597
643
|
);
|
|
598
644
|
this.logger.error(
|
|
@@ -606,17 +652,16 @@ var ServerListenEventError = class {
|
|
|
606
652
|
/**
|
|
607
653
|
*
|
|
608
654
|
* @param warning
|
|
609
|
-
* @param defaultLocalLang
|
|
610
655
|
*/
|
|
611
|
-
|
|
656
|
+
warning(warning) {
|
|
612
657
|
this.stackTrace = this.traceError(
|
|
613
|
-
import_opticore_translator2.TranslationLoader.t(warning.message,
|
|
658
|
+
import_opticore_translator2.TranslationLoader.t(warning.message, this.localeLanguage),
|
|
614
659
|
"warning",
|
|
615
660
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
616
661
|
);
|
|
617
662
|
this.logger.error(
|
|
618
663
|
this.stackTrace.message,
|
|
619
|
-
import_opticore_translator2.TranslationLoader.t("warning",
|
|
664
|
+
import_opticore_translator2.TranslationLoader.t("warning", this.localeLanguage, { warning }),
|
|
620
665
|
this.stackTrace.name,
|
|
621
666
|
this.stackTrace.stack,
|
|
622
667
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
@@ -625,12 +670,11 @@ var ServerListenEventError = class {
|
|
|
625
670
|
/**
|
|
626
671
|
*
|
|
627
672
|
* @param message
|
|
628
|
-
* @param defaultLocalLang
|
|
629
673
|
*/
|
|
630
|
-
|
|
674
|
+
message(message) {
|
|
631
675
|
this.stackTrace = this.traceError(
|
|
632
|
-
import_opticore_translator2.TranslationLoader.t("processGotMsg",
|
|
633
|
-
import_opticore_translator2.TranslationLoader.t("msgException",
|
|
676
|
+
import_opticore_translator2.TranslationLoader.t("processGotMsg", this.localeLanguage, { message }),
|
|
677
|
+
import_opticore_translator2.TranslationLoader.t("msgException", this.localeLanguage, { message }),
|
|
634
678
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
635
679
|
);
|
|
636
680
|
this.logger.error(
|
|
@@ -646,12 +690,11 @@ var ServerListenEventError = class {
|
|
|
646
690
|
* @param type
|
|
647
691
|
* @param promise
|
|
648
692
|
* @param reason
|
|
649
|
-
* @param defaultLocalLang
|
|
650
693
|
*/
|
|
651
|
-
|
|
694
|
+
multipleResolves(type, promise, reason) {
|
|
652
695
|
this.stackTrace = this.traceError(
|
|
653
|
-
import_opticore_translator2.TranslationLoader.t("promiseReason",
|
|
654
|
-
import_opticore_translator2.TranslationLoader.t("multipleResolvesDetected",
|
|
696
|
+
import_opticore_translator2.TranslationLoader.t("promiseReason", this.localeLanguage, { promise, reason }),
|
|
697
|
+
import_opticore_translator2.TranslationLoader.t("multipleResolvesDetected", this.localeLanguage, { type, promise, reason }),
|
|
655
698
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
656
699
|
);
|
|
657
700
|
this.logger.error(
|
|
@@ -665,8 +708,11 @@ var ServerListenEventError = class {
|
|
|
665
708
|
/**
|
|
666
709
|
*
|
|
667
710
|
*/
|
|
668
|
-
|
|
669
|
-
this.logger.success(
|
|
711
|
+
processInterrupted() {
|
|
712
|
+
this.logger.success(
|
|
713
|
+
import_opticore_translator2.TranslationLoader.t("okSuccess", this.localeLanguage),
|
|
714
|
+
import_opticore_translator2.TranslationLoader.t("serverWebStopped", this.localeLanguage)
|
|
715
|
+
);
|
|
670
716
|
import_process.default.exit(0);
|
|
671
717
|
}
|
|
672
718
|
/**
|
|
@@ -674,7 +720,7 @@ var ServerListenEventError = class {
|
|
|
674
720
|
* @param signal
|
|
675
721
|
* @param defaultLocalLang
|
|
676
722
|
*/
|
|
677
|
-
|
|
723
|
+
sigtermSignalReceived(signal, defaultLocalLang) {
|
|
678
724
|
this.stackTrace = this.traceError(
|
|
679
725
|
import_opticore_translator2.TranslationLoader.t("processPIDReceivedSignal", defaultLocalLang, { signal: signal.toString() }),
|
|
680
726
|
"SIGTERM",
|
|
@@ -692,16 +738,16 @@ var ServerListenEventError = class {
|
|
|
692
738
|
/**
|
|
693
739
|
*
|
|
694
740
|
*/
|
|
695
|
-
|
|
696
|
-
console.log(`${import_ansi_colors.default.bgCyanBright(` ${import_ansi_colors.default.bold(`${import_ansi_colors.default.white(` INFO `)}`)}`)} ${import_opticore_translator2.TranslationLoader.t("allProcessStopped",
|
|
697
|
-
console.log(` ${import_opticore_translator2.TranslationLoader.t("serverClosed",
|
|
741
|
+
serverClosing() {
|
|
742
|
+
console.log(`${import_ansi_colors.default.bgCyanBright(` ${import_ansi_colors.default.bold(`${import_ansi_colors.default.white(` INFO `)}`)}`)} ${import_opticore_translator2.TranslationLoader.t("allProcessStopped", this.localeLanguage)}`);
|
|
743
|
+
console.log(` ${import_opticore_translator2.TranslationLoader.t("serverClosed", this.localeLanguage)}`);
|
|
698
744
|
import_process.default.exit();
|
|
699
745
|
}
|
|
700
746
|
/**
|
|
701
747
|
*
|
|
702
748
|
*/
|
|
703
|
-
|
|
704
|
-
console.log(`${import_ansi_colors.default.cyan(`\u24D8`)} ${import_ansi_colors.default.bgCyan(` ${import_ansi_colors.default.bold(`${import_ansi_colors.default.white(` ${import_opticore_translator2.TranslationLoader.t("serverMaxCon",
|
|
749
|
+
dropNewConnection() {
|
|
750
|
+
console.log(`${import_ansi_colors.default.cyan(`\u24D8`)} ${import_ansi_colors.default.bgCyan(` ${import_ansi_colors.default.bold(`${import_ansi_colors.default.white(` ${import_opticore_translator2.TranslationLoader.t("serverMaxCon", this.localeLanguage)} `)}`)} `)} ${dateTimeFormatted} | ${import_ansi_colors.default.bgCyan(`${import_ansi_colors.default.white(` Info `)}`)} ${import_opticore_translator2.TranslationLoader.t("serverDroppedCon", this.localeLanguage)}`);
|
|
705
751
|
}
|
|
706
752
|
/**
|
|
707
753
|
*
|
|
@@ -710,30 +756,29 @@ var ServerListenEventError = class {
|
|
|
710
756
|
* @param req
|
|
711
757
|
* @param res
|
|
712
758
|
* @param next
|
|
713
|
-
* @param defaultLocalLang
|
|
714
759
|
*/
|
|
715
|
-
|
|
760
|
+
expressErrorHandlingMiddleware(errorEmitter, err, req, res, next) {
|
|
716
761
|
if (err) {
|
|
717
762
|
errorEmitter.emit(CEventNameError.error, err);
|
|
718
763
|
if (typeof res.status === "function") {
|
|
719
|
-
res.status(500).send(import_opticore_translator2.TranslationLoader.t("internalServerError",
|
|
764
|
+
res.status(500).send(import_opticore_translator2.TranslationLoader.t("internalServerError", this.localeLanguage, { err }));
|
|
720
765
|
} else {
|
|
721
766
|
this.logger.error(
|
|
722
|
-
import_opticore_translator2.TranslationLoader.t("resStatusNotFunc",
|
|
767
|
+
import_opticore_translator2.TranslationLoader.t("resStatusNotFunc", this.localeLanguage, { err }),
|
|
723
768
|
"response status",
|
|
724
|
-
import_opticore_translator2.TranslationLoader.t("respndNotFunc",
|
|
769
|
+
import_opticore_translator2.TranslationLoader.t("respndNotFunc", this.localeLanguage, { err }),
|
|
725
770
|
err.stack,
|
|
726
771
|
import_opticore_http_response11.HttpStatusCode.NOT_ACCEPTABLE
|
|
727
772
|
);
|
|
728
773
|
}
|
|
729
774
|
this.stackTrace = this.traceError(
|
|
730
775
|
err.message,
|
|
731
|
-
import_opticore_translator2.TranslationLoader.t("expressError",
|
|
776
|
+
import_opticore_translator2.TranslationLoader.t("expressError", this.localeLanguage, { err }),
|
|
732
777
|
import_opticore_http_response11.HttpStatusCode.NOT_ACCEPTABLE
|
|
733
778
|
);
|
|
734
779
|
this.logger.error(
|
|
735
780
|
this.stackTrace.message,
|
|
736
|
-
import_opticore_translator2.TranslationLoader.t("expressErrorHandlingMiddleware",
|
|
781
|
+
import_opticore_translator2.TranslationLoader.t("expressErrorHandlingMiddleware", this.localeLanguage, { err }),
|
|
737
782
|
this.stackTrace.name,
|
|
738
783
|
this.stackTrace.stack,
|
|
739
784
|
import_opticore_http_response11.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
@@ -742,8 +787,216 @@ var ServerListenEventError = class {
|
|
|
742
787
|
next();
|
|
743
788
|
}
|
|
744
789
|
}
|
|
745
|
-
|
|
746
|
-
return new StackTraceError(props, name,
|
|
790
|
+
traceError(props, name, status38) {
|
|
791
|
+
return new StackTraceError(props, name, status38, true);
|
|
792
|
+
}
|
|
793
|
+
};
|
|
794
|
+
|
|
795
|
+
// src/core/errors/stackTraceEACCES.ts
|
|
796
|
+
var import_opticore_http_response12 = require("opticore-http-response");
|
|
797
|
+
var StackTraceEACCES = class extends StackTraceError {
|
|
798
|
+
constructor(message) {
|
|
799
|
+
super(message, CErrorName.eacces, import_opticore_http_response12.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
800
|
+
}
|
|
801
|
+
};
|
|
802
|
+
|
|
803
|
+
// src/core/errors/stackTraceEADDRINUSE.ts
|
|
804
|
+
var import_opticore_http_response13 = require("opticore-http-response");
|
|
805
|
+
var StackTraceEADDRINUSE = class extends StackTraceError {
|
|
806
|
+
constructor(message) {
|
|
807
|
+
super(message, CErrorName.eaddrinuse, import_opticore_http_response13.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
808
|
+
}
|
|
809
|
+
};
|
|
810
|
+
|
|
811
|
+
// src/core/errors/stackTraceECONNREFUSED.ts
|
|
812
|
+
var import_opticore_http_response14 = require("opticore-http-response");
|
|
813
|
+
var StackTraceECONNREFUSED = class extends StackTraceError {
|
|
814
|
+
constructor(message) {
|
|
815
|
+
super(message, CErrorName.econnrefused, import_opticore_http_response14.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
816
|
+
}
|
|
817
|
+
};
|
|
818
|
+
|
|
819
|
+
// src/core/errors/stackTraceECONNRESET.ts
|
|
820
|
+
var import_opticore_http_response15 = require("opticore-http-response");
|
|
821
|
+
var StackTraceECONNRESET = class extends StackTraceError {
|
|
822
|
+
constructor(message) {
|
|
823
|
+
super(message, CErrorName.econnreset, import_opticore_http_response15.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
824
|
+
}
|
|
825
|
+
};
|
|
826
|
+
|
|
827
|
+
// src/core/errors/stackTraceEEXIST.ts
|
|
828
|
+
var import_opticore_http_response16 = require("opticore-http-response");
|
|
829
|
+
var StackTraceEEXIST = class extends StackTraceError {
|
|
830
|
+
constructor(message) {
|
|
831
|
+
super(message, CErrorName.eexist, import_opticore_http_response16.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
832
|
+
}
|
|
833
|
+
};
|
|
834
|
+
|
|
835
|
+
// src/core/errors/stackTraceEISDIR.ts
|
|
836
|
+
var import_opticore_http_response17 = require("opticore-http-response");
|
|
837
|
+
var StackTraceEISDIR = class extends StackTraceError {
|
|
838
|
+
constructor(message) {
|
|
839
|
+
super(message, CErrorName.eisdir, import_opticore_http_response17.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
840
|
+
}
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
// src/core/errors/stackTraceEMFILE.ts
|
|
844
|
+
var import_opticore_http_response18 = require("opticore-http-response");
|
|
845
|
+
var StackTraceEMFILE = class extends StackTraceError {
|
|
846
|
+
constructor(message) {
|
|
847
|
+
super(message, CErrorName.emfile, import_opticore_http_response18.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
848
|
+
}
|
|
849
|
+
};
|
|
850
|
+
|
|
851
|
+
// src/core/errors/stackTraceENOENT.ts
|
|
852
|
+
var import_opticore_http_response19 = require("opticore-http-response");
|
|
853
|
+
var StackTraceENOENT = class extends StackTraceError {
|
|
854
|
+
constructor(message) {
|
|
855
|
+
super(message, CErrorName.enoent, import_opticore_http_response19.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
856
|
+
}
|
|
857
|
+
};
|
|
858
|
+
|
|
859
|
+
// src/core/errors/stackTraceENOTDIR.ts
|
|
860
|
+
var import_opticore_http_response20 = require("opticore-http-response");
|
|
861
|
+
var StackTraceENOTDIR = class extends StackTraceError {
|
|
862
|
+
constructor(message) {
|
|
863
|
+
super(message, CErrorName.enotdir, import_opticore_http_response20.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
864
|
+
}
|
|
865
|
+
};
|
|
866
|
+
|
|
867
|
+
// src/core/errors/stackTraceENOTEMPTY.ts
|
|
868
|
+
var import_opticore_http_response21 = require("opticore-http-response");
|
|
869
|
+
var StackTraceENOTEMPTY = class extends StackTraceError {
|
|
870
|
+
constructor(message) {
|
|
871
|
+
super(message, CErrorName.enotEmpty, import_opticore_http_response21.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
872
|
+
}
|
|
873
|
+
};
|
|
874
|
+
|
|
875
|
+
// src/core/errors/stackTraceEPERM.ts
|
|
876
|
+
var import_opticore_http_response22 = require("opticore-http-response");
|
|
877
|
+
var StackTraceEPERM = class extends StackTraceError {
|
|
878
|
+
constructor(message) {
|
|
879
|
+
super(message, CErrorName.eperm, import_opticore_http_response22.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
880
|
+
}
|
|
881
|
+
};
|
|
882
|
+
|
|
883
|
+
// src/core/errors/stackTraceEPIPE.ts
|
|
884
|
+
var import_opticore_http_response23 = require("opticore-http-response");
|
|
885
|
+
var StackTraceEPIPE = class extends StackTraceError {
|
|
886
|
+
constructor(message) {
|
|
887
|
+
super(message, CErrorName.epipe, import_opticore_http_response23.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
888
|
+
}
|
|
889
|
+
};
|
|
890
|
+
|
|
891
|
+
// src/core/errors/stackTraceETIMEDOUT.ts
|
|
892
|
+
var import_opticore_http_response24 = require("opticore-http-response");
|
|
893
|
+
var StackTraceETIMEDOUT = class extends StackTraceError {
|
|
894
|
+
constructor(message) {
|
|
895
|
+
super(message, CErrorName.etimedout, import_opticore_http_response24.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
896
|
+
}
|
|
897
|
+
};
|
|
898
|
+
|
|
899
|
+
// src/core/errors/stackTraceERR_OSSL_EVP_UNSUPPORTED.ts
|
|
900
|
+
var import_opticore_http_response25 = require("opticore-http-response");
|
|
901
|
+
var StackTraceERR_OSSL_EVP_UNSUPPORTED = class extends StackTraceError {
|
|
902
|
+
constructor(message) {
|
|
903
|
+
super(message, CErrorName.errOsslEvpUnsupported, import_opticore_http_response25.HttpStatusCode.NOT_ACCEPTABLE, true);
|
|
904
|
+
}
|
|
905
|
+
};
|
|
906
|
+
|
|
907
|
+
// src/core/errors/stackTraceERR_OSSL_BAD_DECRYPT.ts
|
|
908
|
+
var import_opticore_http_response26 = require("opticore-http-response");
|
|
909
|
+
var StackTraceERR_OSSL_BAD_DECRYPT = class extends StackTraceError {
|
|
910
|
+
constructor(message) {
|
|
911
|
+
super(message, CErrorName.errOsslBadDecrypt, import_opticore_http_response26.HttpStatusCode.BAD_REQUEST, true);
|
|
912
|
+
}
|
|
913
|
+
};
|
|
914
|
+
|
|
915
|
+
// src/core/errors/stackTraceERR_OSSL_WRONG_FINAL_BLOCK_LENGTH.ts
|
|
916
|
+
var import_opticore_http_response27 = require("opticore-http-response");
|
|
917
|
+
var StackTraceERR_OSSL_WRONG_FINAL_BLOCK_LENGTH = class extends StackTraceError {
|
|
918
|
+
constructor(message) {
|
|
919
|
+
super(message, CErrorName.errOsslWrongFinalBlockLength, import_opticore_http_response27.HttpStatusCode.NOT_ACCEPTABLE, true);
|
|
920
|
+
}
|
|
921
|
+
};
|
|
922
|
+
|
|
923
|
+
// src/core/errors/stackTraceERR_INVALID_ARG_TYPE.ts
|
|
924
|
+
var import_opticore_http_response28 = require("opticore-http-response");
|
|
925
|
+
var StackTraceERR_INVALID_ARG_TYPE = class extends StackTraceError {
|
|
926
|
+
constructor(message) {
|
|
927
|
+
super(message, CErrorName.errInvalidArgType, import_opticore_http_response28.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
928
|
+
}
|
|
929
|
+
};
|
|
930
|
+
|
|
931
|
+
// src/core/errors/stackTraceERR_INVALID_CALLBACK.ts
|
|
932
|
+
var import_opticore_http_response29 = require("opticore-http-response");
|
|
933
|
+
var StackTraceERR_INVALID_CALLBACK = class extends StackTraceError {
|
|
934
|
+
constructor(message) {
|
|
935
|
+
super(message, CErrorName.errInvalidCallback, import_opticore_http_response29.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
936
|
+
}
|
|
937
|
+
};
|
|
938
|
+
|
|
939
|
+
// src/core/errors/stackTraceERR_HTTP_HEADERS_SENT.ts
|
|
940
|
+
var import_opticore_http_response30 = require("opticore-http-response");
|
|
941
|
+
var StackTraceERR_HTTP_HEADERS_SENT = class extends StackTraceError {
|
|
942
|
+
constructor(message) {
|
|
943
|
+
super(message, CErrorName.errHttpHeadersSent, import_opticore_http_response30.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
944
|
+
}
|
|
945
|
+
};
|
|
946
|
+
|
|
947
|
+
// src/core/errors/stackTraceERR_STREAM_DESTROYED.ts
|
|
948
|
+
var import_opticore_http_response31 = require("opticore-http-response");
|
|
949
|
+
var StackTraceERR_STREAM_DESTROYED = class extends StackTraceError {
|
|
950
|
+
constructor(message) {
|
|
951
|
+
super(message, CErrorName.errStreamDestroyed, import_opticore_http_response31.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
952
|
+
}
|
|
953
|
+
};
|
|
954
|
+
|
|
955
|
+
// src/core/errors/stackTraceERR_TLS_CERT_ALTNAME_INVALID.ts
|
|
956
|
+
var import_opticore_http_response32 = require("opticore-http-response");
|
|
957
|
+
var StackTraceERR_TLS_CERT_ALTNAME_INVALID = class extends StackTraceError {
|
|
958
|
+
constructor(message) {
|
|
959
|
+
super(message, CErrorName.errTlsCertAltnameInvalid, import_opticore_http_response32.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
960
|
+
}
|
|
961
|
+
};
|
|
962
|
+
|
|
963
|
+
// src/core/errors/stackTraceERR_UNSUPPORTED_ESM_URL_SCHEME.ts
|
|
964
|
+
var import_opticore_http_response33 = require("opticore-http-response");
|
|
965
|
+
var StackTraceERR_UNSUPPORTED_ESM_URL_SCHEME = class extends StackTraceError {
|
|
966
|
+
constructor(message) {
|
|
967
|
+
super(message, CErrorName.errUnsupportedEsmUrlScheme, import_opticore_http_response33.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
968
|
+
}
|
|
969
|
+
};
|
|
970
|
+
|
|
971
|
+
// src/core/errors/stackTraceUncaughtException.ts
|
|
972
|
+
var import_opticore_http_response34 = require("opticore-http-response");
|
|
973
|
+
var StackTraceUncaughtException = class extends StackTraceError {
|
|
974
|
+
constructor(message) {
|
|
975
|
+
super(message, CEvent.uncaughtException, import_opticore_http_response34.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
976
|
+
}
|
|
977
|
+
};
|
|
978
|
+
|
|
979
|
+
// src/core/errors/stackTraceUnhandledRejection.ts
|
|
980
|
+
var import_opticore_http_response35 = require("opticore-http-response");
|
|
981
|
+
var StackTraceUnhandledRejection = class extends StackTraceError {
|
|
982
|
+
constructor(message) {
|
|
983
|
+
super(message, CEvent.unhandledRejection, import_opticore_http_response35.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
984
|
+
}
|
|
985
|
+
};
|
|
986
|
+
|
|
987
|
+
// src/core/errors/stackTraceBeforeExit.ts
|
|
988
|
+
var import_opticore_http_response36 = require("opticore-http-response");
|
|
989
|
+
var StackTraceBeforeExit = class extends StackTraceError {
|
|
990
|
+
constructor(message) {
|
|
991
|
+
super(message, CEvent.beforeExit, import_opticore_http_response36.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
992
|
+
}
|
|
993
|
+
};
|
|
994
|
+
|
|
995
|
+
// src/core/errors/stackTraceExit.ts
|
|
996
|
+
var import_opticore_http_response37 = require("opticore-http-response");
|
|
997
|
+
var StackTraceExit = class extends StackTraceError {
|
|
998
|
+
constructor(message) {
|
|
999
|
+
super(message, CEvent.exit, import_opticore_http_response37.HttpStatusCode.INTERNAL_SERVER_ERROR, true);
|
|
747
1000
|
}
|
|
748
1001
|
};
|
|
749
1002
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -753,8 +1006,32 @@ var ServerListenEventError = class {
|
|
|
753
1006
|
CEventNameError,
|
|
754
1007
|
ServerListenEventError,
|
|
755
1008
|
StackTraceAssertionError,
|
|
1009
|
+
StackTraceBeforeExit,
|
|
1010
|
+
StackTraceEACCES,
|
|
1011
|
+
StackTraceEADDRINUSE,
|
|
1012
|
+
StackTraceECONNREFUSED,
|
|
1013
|
+
StackTraceECONNRESET,
|
|
1014
|
+
StackTraceEEXIST,
|
|
1015
|
+
StackTraceEISDIR,
|
|
1016
|
+
StackTraceEMFILE,
|
|
1017
|
+
StackTraceENOENT,
|
|
1018
|
+
StackTraceENOTDIR,
|
|
1019
|
+
StackTraceENOTEMPTY,
|
|
1020
|
+
StackTraceEPERM,
|
|
1021
|
+
StackTraceEPIPE,
|
|
1022
|
+
StackTraceERR_HTTP_HEADERS_SENT,
|
|
1023
|
+
StackTraceERR_INVALID_ARG_TYPE,
|
|
1024
|
+
StackTraceERR_INVALID_CALLBACK,
|
|
1025
|
+
StackTraceERR_OSSL_BAD_DECRYPT,
|
|
1026
|
+
StackTraceERR_OSSL_EVP_UNSUPPORTED,
|
|
1027
|
+
StackTraceERR_OSSL_WRONG_FINAL_BLOCK_LENGTH,
|
|
1028
|
+
StackTraceERR_STREAM_DESTROYED,
|
|
1029
|
+
StackTraceERR_TLS_CERT_ALTNAME_INVALID,
|
|
1030
|
+
StackTraceERR_UNSUPPORTED_ESM_URL_SCHEME,
|
|
1031
|
+
StackTraceETIMEDOUT,
|
|
756
1032
|
StackTraceError,
|
|
757
1033
|
StackTraceEvalError,
|
|
1034
|
+
StackTraceExit,
|
|
758
1035
|
StackTraceGeneralError,
|
|
759
1036
|
StackTraceOpenSSLError,
|
|
760
1037
|
StackTraceRangeError,
|
|
@@ -762,5 +1039,7 @@ var ServerListenEventError = class {
|
|
|
762
1039
|
StackTraceSyntaxError,
|
|
763
1040
|
StackTraceSystemError,
|
|
764
1041
|
StackTraceTypeError,
|
|
765
|
-
StackTraceURIError
|
|
1042
|
+
StackTraceURIError,
|
|
1043
|
+
StackTraceUncaughtException,
|
|
1044
|
+
StackTraceUnhandledRejection
|
|
766
1045
|
});
|