opticore-catch-exception-error 1.0.21 → 1.0.22
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 +571 -545
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +504 -478
- package/dist/utils/translations/message.translation.en.json +58 -0
- package/dist/utils/translations/message.translation.fr.json +58 -0
- package/package.json +7 -5
package/dist/index.cjs
CHANGED
|
@@ -121,9 +121,10 @@ var CEventNameError = {
|
|
|
121
121
|
var import_process = __toESM(require("process"), 1);
|
|
122
122
|
var import_ansi_colors = __toESM(require("ansi-colors"), 1);
|
|
123
123
|
var import_chalk = __toESM(require("chalk"), 1);
|
|
124
|
-
var
|
|
125
|
-
var
|
|
124
|
+
var import_opticore_logger2 = require("opticore-logger");
|
|
125
|
+
var import_opticore_http_response2 = require("opticore-http-response");
|
|
126
126
|
var import_opticore_translator2 = require("opticore-translator");
|
|
127
|
+
var import_opticore_server_logger = require("opticore-server-logger");
|
|
127
128
|
|
|
128
129
|
// src/core/errors/base/stackTraceError.ts
|
|
129
130
|
var StackTraceError = class extends Error {
|
|
@@ -148,12 +149,14 @@ var StackTraceError = class extends Error {
|
|
|
148
149
|
};
|
|
149
150
|
|
|
150
151
|
// src/utils/dateTimeFormatted.utils.ts
|
|
151
|
-
var dateTimeFormatted =
|
|
152
|
+
var dateTimeFormatted = (/* @__PURE__ */ new Date()).toString();
|
|
152
153
|
|
|
153
154
|
// src/core/config/loaders/translateLanguage.loader.ts
|
|
154
155
|
var import_path = __toESM(require("path"), 1);
|
|
155
156
|
var import_module = require("module");
|
|
156
157
|
var import_opticore_translator = require("opticore-translator");
|
|
158
|
+
var import_opticore_logger = require("opticore-logger");
|
|
159
|
+
var import_opticore_http_response = require("opticore-http-response");
|
|
157
160
|
var translateCatchExceptionErrorLanguageLoader = () => {
|
|
158
161
|
try {
|
|
159
162
|
const require2 = (0, import_module.createRequire)(importMetaUrl);
|
|
@@ -161,17 +164,26 @@ var translateCatchExceptionErrorLanguageLoader = () => {
|
|
|
161
164
|
const translateMsgJsonFilePath = import_path.default.join(packagePath, "utils", "translations");
|
|
162
165
|
import_opticore_translator.TranslationLoader.loadTranslations(translateMsgJsonFilePath);
|
|
163
166
|
} catch (err) {
|
|
167
|
+
new import_opticore_logger.LoggerCore().error({
|
|
168
|
+
message: err.message,
|
|
169
|
+
title: "Translation Loader",
|
|
170
|
+
errorType: "No translations loading",
|
|
171
|
+
stackTrace: void 0,
|
|
172
|
+
httpCodeValue: import_opticore_http_response.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
173
|
+
});
|
|
164
174
|
}
|
|
165
175
|
};
|
|
166
176
|
|
|
167
177
|
// src/core/errors/events/serverListen.event.error.ts
|
|
168
178
|
var ServerListenEventError = class {
|
|
169
|
-
logger = new
|
|
179
|
+
logger = new import_opticore_logger2.LoggerCore();
|
|
170
180
|
stackTrace;
|
|
171
181
|
localeLanguage;
|
|
182
|
+
serverLogger;
|
|
172
183
|
constructor(defaultLocalLang) {
|
|
173
|
-
this.localeLanguage = defaultLocalLang;
|
|
174
184
|
translateCatchExceptionErrorLanguageLoader();
|
|
185
|
+
this.localeLanguage = defaultLocalLang;
|
|
186
|
+
this.serverLogger = new import_opticore_server_logger.serverLogger();
|
|
175
187
|
}
|
|
176
188
|
/**
|
|
177
189
|
* @param appPort
|
|
@@ -181,15 +193,15 @@ var ServerListenEventError = class {
|
|
|
181
193
|
this.stackTrace = this.traceError(
|
|
182
194
|
import_opticore_translator2.TranslationLoader.t("errorHostUrl", this.localeLanguage),
|
|
183
195
|
import_opticore_translator2.TranslationLoader.t("listening", this.localeLanguage),
|
|
184
|
-
|
|
185
|
-
);
|
|
186
|
-
this.logger.error(
|
|
187
|
-
this.stackTrace.message,
|
|
188
|
-
import_opticore_translator2.TranslationLoader.t("webServer", this.localeLanguage),
|
|
189
|
-
import_opticore_translator2.TranslationLoader.t("badPort", this.localeLanguage, { badPort: appPort }),
|
|
190
|
-
this.stackTrace.stack,
|
|
191
|
-
import_opticore_http_response.HttpStatusCode.BAD_REQUEST
|
|
196
|
+
import_opticore_http_response2.HttpStatusCode.BAD_REQUEST
|
|
192
197
|
);
|
|
198
|
+
this.logger.error({
|
|
199
|
+
message: this.stackTrace.message,
|
|
200
|
+
title: import_opticore_translator2.TranslationLoader.t("webServer", this.localeLanguage),
|
|
201
|
+
errorType: import_opticore_translator2.TranslationLoader.t("badPort", this.localeLanguage, { badPort: appPort }),
|
|
202
|
+
stackTrace: this.stackTrace.stack,
|
|
203
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.BAD_REQUEST
|
|
204
|
+
});
|
|
193
205
|
import_process.default.exit();
|
|
194
206
|
}
|
|
195
207
|
/**
|
|
@@ -200,15 +212,15 @@ var ServerListenEventError = class {
|
|
|
200
212
|
this.stackTrace = this.traceError(
|
|
201
213
|
import_opticore_translator2.TranslationLoader.t("badHost", this.localeLanguage, { badHost: appHost }),
|
|
202
214
|
import_opticore_translator2.TranslationLoader.t("listening", this.localeLanguage),
|
|
203
|
-
|
|
204
|
-
);
|
|
205
|
-
this.logger.error(
|
|
206
|
-
this.stackTrace.message,
|
|
207
|
-
import_opticore_translator2.TranslationLoader.t("webServer", this.localeLanguage),
|
|
208
|
-
import_opticore_translator2.TranslationLoader.t("badHost", this.localeLanguage),
|
|
209
|
-
this.stackTrace.stack,
|
|
210
|
-
import_opticore_http_response.HttpStatusCode.BAD_REQUEST
|
|
215
|
+
import_opticore_http_response2.HttpStatusCode.BAD_REQUEST
|
|
211
216
|
);
|
|
217
|
+
this.logger.error({
|
|
218
|
+
message: this.stackTrace.message,
|
|
219
|
+
title: import_opticore_translator2.TranslationLoader.t("webServer", this.localeLanguage),
|
|
220
|
+
errorType: import_opticore_translator2.TranslationLoader.t("badHost", this.localeLanguage),
|
|
221
|
+
stackTrace: this.stackTrace.stack,
|
|
222
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.BAD_REQUEST
|
|
223
|
+
});
|
|
212
224
|
import_process.default.exit();
|
|
213
225
|
}
|
|
214
226
|
/**
|
|
@@ -218,15 +230,15 @@ var ServerListenEventError = class {
|
|
|
218
230
|
this.stackTrace = this.traceError(
|
|
219
231
|
import_opticore_translator2.TranslationLoader.t("badPort", this.localeLanguage),
|
|
220
232
|
import_opticore_translator2.TranslationLoader.t("listening", this.localeLanguage),
|
|
221
|
-
|
|
222
|
-
);
|
|
223
|
-
this.logger.error(
|
|
224
|
-
this.stackTrace.message,
|
|
225
|
-
import_opticore_translator2.TranslationLoader.t("webServer", this.localeLanguage),
|
|
226
|
-
import_opticore_translator2.TranslationLoader.t("badPort", this.localeLanguage),
|
|
227
|
-
this.stackTrace.stack,
|
|
228
|
-
import_opticore_http_response.HttpStatusCode.BAD_REQUEST
|
|
233
|
+
import_opticore_http_response2.HttpStatusCode.BAD_REQUEST
|
|
229
234
|
);
|
|
235
|
+
this.logger.error({
|
|
236
|
+
message: this.stackTrace.message,
|
|
237
|
+
title: import_opticore_translator2.TranslationLoader.t("webServer", this.localeLanguage),
|
|
238
|
+
errorType: import_opticore_translator2.TranslationLoader.t("badPort", this.localeLanguage),
|
|
239
|
+
stackTrace: this.stackTrace.stack,
|
|
240
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.BAD_REQUEST
|
|
241
|
+
});
|
|
230
242
|
import_process.default.exit();
|
|
231
243
|
}
|
|
232
244
|
/**
|
|
@@ -234,13 +246,13 @@ var ServerListenEventError = class {
|
|
|
234
246
|
*
|
|
235
247
|
*/
|
|
236
248
|
onEventError(err) {
|
|
237
|
-
this.logger.error(
|
|
238
|
-
import_opticore_translator2.TranslationLoader.t(err.message, this.localeLanguage),
|
|
239
|
-
import_opticore_translator2.TranslationLoader.t("serverStart", this.localeLanguage),
|
|
240
|
-
import_opticore_translator2.TranslationLoader.t("serverStartError", this.localeLanguage, { err }),
|
|
241
|
-
err.stack,
|
|
242
|
-
|
|
243
|
-
);
|
|
249
|
+
this.logger.error({
|
|
250
|
+
message: import_opticore_translator2.TranslationLoader.t(err.message, this.localeLanguage),
|
|
251
|
+
title: import_opticore_translator2.TranslationLoader.t("serverStart", this.localeLanguage),
|
|
252
|
+
errorType: import_opticore_translator2.TranslationLoader.t("serverStartError", this.localeLanguage, { err }),
|
|
253
|
+
stackTrace: err.stack,
|
|
254
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
255
|
+
});
|
|
244
256
|
}
|
|
245
257
|
/**
|
|
246
258
|
*
|
|
@@ -250,15 +262,15 @@ var ServerListenEventError = class {
|
|
|
250
262
|
this.stackTrace = this.traceError(
|
|
251
263
|
error.message,
|
|
252
264
|
error.name,
|
|
253
|
-
|
|
254
|
-
);
|
|
255
|
-
this.logger.error(
|
|
256
|
-
this.stackTrace.message,
|
|
257
|
-
"Event error",
|
|
258
|
-
"Error",
|
|
259
|
-
error.stack,
|
|
260
|
-
import_opticore_http_response.HttpStatusCode.BAD_REQUEST
|
|
265
|
+
import_opticore_http_response2.HttpStatusCode.BAD_REQUEST
|
|
261
266
|
);
|
|
267
|
+
this.logger.error({
|
|
268
|
+
message: this.stackTrace.message,
|
|
269
|
+
title: "Event error",
|
|
270
|
+
errorType: "Error",
|
|
271
|
+
stackTrace: error.stack,
|
|
272
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.BAD_REQUEST
|
|
273
|
+
});
|
|
262
274
|
}
|
|
263
275
|
/**
|
|
264
276
|
* @param code
|
|
@@ -268,15 +280,15 @@ var ServerListenEventError = class {
|
|
|
268
280
|
this.stackTrace = this.traceError(
|
|
269
281
|
import_opticore_translator2.TranslationLoader.t("processExitCode", this.localeLanguage, { processExitCode: code }),
|
|
270
282
|
import_opticore_translator2.TranslationLoader.t("beforeExit", this.localeLanguage),
|
|
271
|
-
|
|
272
|
-
);
|
|
273
|
-
this.logger.error(
|
|
274
|
-
this.stackTrace.message,
|
|
275
|
-
import_opticore_translator2.TranslationLoader.t("beforeExit", this.localeLanguage),
|
|
276
|
-
import_opticore_translator2.TranslationLoader.t("processBeforeExit", this.localeLanguage),
|
|
277
|
-
this.stackTrace.stack,
|
|
278
|
-
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
283
|
+
import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
279
284
|
);
|
|
285
|
+
this.logger.error({
|
|
286
|
+
message: this.stackTrace.message,
|
|
287
|
+
title: import_opticore_translator2.TranslationLoader.t("beforeExit", this.localeLanguage),
|
|
288
|
+
errorType: import_opticore_translator2.TranslationLoader.t("processBeforeExit", this.localeLanguage),
|
|
289
|
+
stackTrace: this.stackTrace.stack,
|
|
290
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
291
|
+
});
|
|
280
292
|
import_process.default.exit(code);
|
|
281
293
|
}
|
|
282
294
|
/**
|
|
@@ -286,15 +298,15 @@ var ServerListenEventError = class {
|
|
|
286
298
|
this.stackTrace = this.traceError(
|
|
287
299
|
import_opticore_translator2.TranslationLoader.t("childProcessDiscon", this.localeLanguage),
|
|
288
300
|
import_opticore_translator2.TranslationLoader.t("processDiscon", this.localeLanguage),
|
|
289
|
-
|
|
290
|
-
);
|
|
291
|
-
this.logger.error(
|
|
292
|
-
this.stackTrace.message,
|
|
293
|
-
import_opticore_translator2.TranslationLoader.t("disconnected", this.localeLanguage),
|
|
294
|
-
import_opticore_translator2.TranslationLoader.t("processDiscon", this.localeLanguage),
|
|
295
|
-
this.stackTrace.stack,
|
|
296
|
-
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
301
|
+
import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
297
302
|
);
|
|
303
|
+
this.logger.error({
|
|
304
|
+
message: this.stackTrace.message,
|
|
305
|
+
title: import_opticore_translator2.TranslationLoader.t("disconnected", this.localeLanguage),
|
|
306
|
+
errorType: import_opticore_translator2.TranslationLoader.t("processDiscon", this.localeLanguage),
|
|
307
|
+
stackTrace: this.stackTrace.stack,
|
|
308
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
309
|
+
});
|
|
298
310
|
import_process.default.exit();
|
|
299
311
|
}
|
|
300
312
|
/**
|
|
@@ -304,10 +316,10 @@ var ServerListenEventError = class {
|
|
|
304
316
|
exited(code) {
|
|
305
317
|
switch (code) {
|
|
306
318
|
case 0:
|
|
307
|
-
this.logger.success(
|
|
308
|
-
import_opticore_translator2.TranslationLoader.t("completed", this.localeLanguage, { code }),
|
|
309
|
-
import_opticore_translator2.TranslationLoader.t("finishingProcessWell", this.localeLanguage, { code })
|
|
310
|
-
);
|
|
319
|
+
this.logger.success({
|
|
320
|
+
title: import_opticore_translator2.TranslationLoader.t("completed", this.localeLanguage, { code }),
|
|
321
|
+
message: import_opticore_translator2.TranslationLoader.t("finishingProcessWell", this.localeLanguage, { code })
|
|
322
|
+
});
|
|
311
323
|
console.log("");
|
|
312
324
|
const paddingLength = 35;
|
|
313
325
|
const msg0 = " ".padEnd(paddingLength, " ");
|
|
@@ -319,155 +331,155 @@ var ServerListenEventError = class {
|
|
|
319
331
|
this.stackTrace = this.traceError(
|
|
320
332
|
import_opticore_translator2.TranslationLoader.t("somethingWentWrong", this.localeLanguage),
|
|
321
333
|
import_opticore_translator2.TranslationLoader.t("genErrors", this.localeLanguage),
|
|
322
|
-
|
|
323
|
-
);
|
|
324
|
-
this.logger.error(
|
|
325
|
-
this.stackTrace.message,
|
|
326
|
-
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
327
|
-
"General Errors",
|
|
328
|
-
this.stackTrace.stack,
|
|
329
|
-
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
334
|
+
import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
330
335
|
);
|
|
336
|
+
this.logger.error({
|
|
337
|
+
message: this.stackTrace.message,
|
|
338
|
+
title: import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
339
|
+
errorType: "General Errors",
|
|
340
|
+
stackTrace: this.stackTrace.stack,
|
|
341
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
342
|
+
});
|
|
331
343
|
break;
|
|
332
344
|
case 2:
|
|
333
345
|
this.stackTrace = this.traceError(
|
|
334
346
|
import_opticore_translator2.TranslationLoader.t("incorrectCmd", this.localeLanguage),
|
|
335
347
|
import_opticore_translator2.TranslationLoader.t("misuseShell", this.localeLanguage),
|
|
336
|
-
|
|
337
|
-
);
|
|
338
|
-
this.logger.error(
|
|
339
|
-
this.stackTrace.message,
|
|
340
|
-
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
341
|
-
import_opticore_translator2.TranslationLoader.t("incorrectCmd", this.localeLanguage),
|
|
342
|
-
this.stackTrace.stack,
|
|
343
|
-
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
348
|
+
import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
344
349
|
);
|
|
350
|
+
this.logger.error({
|
|
351
|
+
message: this.stackTrace.message,
|
|
352
|
+
title: import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
353
|
+
errorType: import_opticore_translator2.TranslationLoader.t("incorrectCmd", this.localeLanguage),
|
|
354
|
+
stackTrace: this.stackTrace.stack,
|
|
355
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
356
|
+
});
|
|
345
357
|
break;
|
|
346
358
|
case 126:
|
|
347
359
|
this.stackTrace = this.traceError(
|
|
348
360
|
import_opticore_translator2.TranslationLoader.t("incorrectCmd", this.localeLanguage),
|
|
349
361
|
import_opticore_translator2.TranslationLoader.t("cmdNotExecutable", this.localeLanguage),
|
|
350
|
-
|
|
351
|
-
);
|
|
352
|
-
this.logger.error(
|
|
353
|
-
this.stackTrace.message,
|
|
354
|
-
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
355
|
-
this.stackTrace.name,
|
|
356
|
-
this.stackTrace.stack,
|
|
357
|
-
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
362
|
+
import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
358
363
|
);
|
|
364
|
+
this.logger.error({
|
|
365
|
+
message: this.stackTrace.message,
|
|
366
|
+
title: import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
367
|
+
errorType: this.stackTrace.name,
|
|
368
|
+
stackTrace: this.stackTrace.stack,
|
|
369
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
370
|
+
});
|
|
359
371
|
break;
|
|
360
372
|
case 127:
|
|
361
373
|
this.stackTrace = this.traceError(
|
|
362
374
|
import_opticore_translator2.TranslationLoader.t("cmdNotFound", this.localeLanguage),
|
|
363
375
|
import_opticore_translator2.TranslationLoader.t("cmdNotFoundInSystemPath", this.localeLanguage),
|
|
364
|
-
|
|
365
|
-
);
|
|
366
|
-
this.logger.error(
|
|
367
|
-
this.stackTrace.message,
|
|
368
|
-
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
369
|
-
this.stackTrace.name,
|
|
370
|
-
this.stackTrace.stack,
|
|
371
|
-
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
376
|
+
import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
372
377
|
);
|
|
378
|
+
this.logger.error({
|
|
379
|
+
message: this.stackTrace.message,
|
|
380
|
+
title: import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
381
|
+
errorType: this.stackTrace.name,
|
|
382
|
+
stackTrace: this.stackTrace.stack,
|
|
383
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
384
|
+
});
|
|
373
385
|
break;
|
|
374
386
|
case 128:
|
|
375
387
|
this.stackTrace = this.traceError(
|
|
376
388
|
import_opticore_translator2.TranslationLoader.t("cmdNotFoundInSystemPath", this.localeLanguage),
|
|
377
389
|
import_opticore_translator2.TranslationLoader.t("argInvalid", this.localeLanguage),
|
|
378
|
-
|
|
379
|
-
);
|
|
380
|
-
this.logger.error(
|
|
381
|
-
this.stackTrace.message,
|
|
382
|
-
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
383
|
-
this.stackTrace.name,
|
|
384
|
-
this.stackTrace.stack,
|
|
385
|
-
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
390
|
+
import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
386
391
|
);
|
|
392
|
+
this.logger.error({
|
|
393
|
+
message: this.stackTrace.message,
|
|
394
|
+
title: import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
395
|
+
errorType: this.stackTrace.name,
|
|
396
|
+
stackTrace: this.stackTrace.stack,
|
|
397
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
398
|
+
});
|
|
387
399
|
break;
|
|
388
400
|
case 130:
|
|
389
401
|
this.stackTrace = this.traceError(
|
|
390
402
|
import_opticore_translator2.TranslationLoader.t("scriptEndedManuallyByCtrlC", this.localeLanguage),
|
|
391
403
|
import_opticore_translator2.TranslationLoader.t("scriptEnded", this.localeLanguage),
|
|
392
|
-
|
|
393
|
-
);
|
|
394
|
-
this.logger.error(
|
|
395
|
-
this.stackTrace.message,
|
|
396
|
-
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
397
|
-
this.stackTrace.name,
|
|
398
|
-
this.stackTrace.stack,
|
|
399
|
-
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
404
|
+
import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
400
405
|
);
|
|
406
|
+
this.logger.error({
|
|
407
|
+
message: this.stackTrace.message,
|
|
408
|
+
title: import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
409
|
+
errorType: this.stackTrace.name,
|
|
410
|
+
stackTrace: this.stackTrace.stack,
|
|
411
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
412
|
+
});
|
|
401
413
|
break;
|
|
402
414
|
case 137:
|
|
403
415
|
this.stackTrace = this.traceError(
|
|
404
416
|
import_opticore_translator2.TranslationLoader.t("processEndedBySIGKILL", this.localeLanguage),
|
|
405
417
|
"SIGKILL",
|
|
406
|
-
|
|
407
|
-
);
|
|
408
|
-
this.logger.error(
|
|
409
|
-
this.stackTrace.message,
|
|
410
|
-
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
411
|
-
this.stackTrace.name,
|
|
412
|
-
this.stackTrace.stack,
|
|
413
|
-
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
418
|
+
import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
414
419
|
);
|
|
420
|
+
this.logger.error({
|
|
421
|
+
message: this.stackTrace.message,
|
|
422
|
+
title: import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
423
|
+
errorType: this.stackTrace.name,
|
|
424
|
+
stackTrace: this.stackTrace.stack,
|
|
425
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
426
|
+
});
|
|
415
427
|
break;
|
|
416
428
|
case 139:
|
|
417
429
|
this.stackTrace = this.traceError(
|
|
418
430
|
import_opticore_translator2.TranslationLoader.t("accessProcessIllegally", this.localeLanguage),
|
|
419
431
|
import_opticore_translator2.TranslationLoader.t("defaultSegment", this.localeLanguage),
|
|
420
|
-
|
|
421
|
-
);
|
|
422
|
-
this.logger.error(
|
|
423
|
-
this.stackTrace.message,
|
|
424
|
-
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
425
|
-
this.stackTrace.name,
|
|
426
|
-
this.stackTrace.stack,
|
|
427
|
-
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
432
|
+
import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
428
433
|
);
|
|
434
|
+
this.logger.error({
|
|
435
|
+
message: this.stackTrace.message,
|
|
436
|
+
title: import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
437
|
+
errorType: this.stackTrace.name,
|
|
438
|
+
stackTrace: this.stackTrace.stack,
|
|
439
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
440
|
+
});
|
|
429
441
|
break;
|
|
430
442
|
case 143:
|
|
431
443
|
this.stackTrace = this.traceError(
|
|
432
444
|
import_opticore_translator2.TranslationLoader.t("processReceivedSigtermSignal", this.localeLanguage),
|
|
433
445
|
import_opticore_translator2.TranslationLoader.t("processReceived", this.localeLanguage),
|
|
434
|
-
|
|
435
|
-
);
|
|
436
|
-
this.logger.error(
|
|
437
|
-
this.stackTrace.message,
|
|
438
|
-
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
439
|
-
this.stackTrace.name,
|
|
440
|
-
this.stackTrace.stack,
|
|
441
|
-
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
446
|
+
import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
442
447
|
);
|
|
448
|
+
this.logger.error({
|
|
449
|
+
message: this.stackTrace.message,
|
|
450
|
+
title: import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
451
|
+
errorType: this.stackTrace.name,
|
|
452
|
+
stackTrace: this.stackTrace.stack,
|
|
453
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
454
|
+
});
|
|
443
455
|
break;
|
|
444
456
|
case 255:
|
|
445
457
|
this.stackTrace = this.traceError(
|
|
446
458
|
import_opticore_translator2.TranslationLoader.t("exitCode", this.localeLanguage),
|
|
447
459
|
import_opticore_translator2.TranslationLoader.t("outRange", this.localeLanguage),
|
|
448
|
-
|
|
449
|
-
);
|
|
450
|
-
this.logger.error(
|
|
451
|
-
this.stackTrace.message,
|
|
452
|
-
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
453
|
-
this.stackTrace.name,
|
|
454
|
-
this.stackTrace.stack,
|
|
455
|
-
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
460
|
+
import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
456
461
|
);
|
|
462
|
+
this.logger.error({
|
|
463
|
+
message: this.stackTrace.message,
|
|
464
|
+
title: import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
465
|
+
errorType: this.stackTrace.name,
|
|
466
|
+
stackTrace: this.stackTrace.stack,
|
|
467
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
468
|
+
});
|
|
457
469
|
break;
|
|
458
470
|
default:
|
|
459
471
|
this.stackTrace = this.traceError(
|
|
460
472
|
import_opticore_translator2.TranslationLoader.t("errorOccurring", this.localeLanguage),
|
|
461
473
|
import_opticore_translator2.TranslationLoader.t("errors", this.localeLanguage),
|
|
462
|
-
|
|
463
|
-
);
|
|
464
|
-
this.logger.error(
|
|
465
|
-
this.stackTrace.message,
|
|
466
|
-
import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
467
|
-
this.stackTrace.name,
|
|
468
|
-
this.stackTrace.stack,
|
|
469
|
-
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
474
|
+
import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
470
475
|
);
|
|
476
|
+
this.logger.error({
|
|
477
|
+
message: this.stackTrace.message,
|
|
478
|
+
title: import_opticore_translator2.TranslationLoader.t("exited", this.localeLanguage),
|
|
479
|
+
errorType: this.stackTrace.name,
|
|
480
|
+
stackTrace: this.stackTrace.stack,
|
|
481
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
482
|
+
});
|
|
471
483
|
break;
|
|
472
484
|
}
|
|
473
485
|
}
|
|
@@ -479,15 +491,15 @@ var ServerListenEventError = class {
|
|
|
479
491
|
this.stackTrace = this.traceError(
|
|
480
492
|
import_opticore_translator2.TranslationLoader.t("promise", this.localeLanguage, { promise }),
|
|
481
493
|
import_opticore_translator2.TranslationLoader.t("rejectionPromise", this.localeLanguage, { promise }),
|
|
482
|
-
|
|
483
|
-
);
|
|
484
|
-
this.logger.error(
|
|
485
|
-
this.stackTrace.message,
|
|
486
|
-
"PromiseRejectionHandled",
|
|
487
|
-
this.stackTrace.name,
|
|
488
|
-
promise,
|
|
489
|
-
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
494
|
+
import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
490
495
|
);
|
|
496
|
+
this.logger.error({
|
|
497
|
+
message: this.stackTrace.message,
|
|
498
|
+
title: "PromiseRejectionHandled",
|
|
499
|
+
errorType: this.stackTrace.name,
|
|
500
|
+
stackTrace: promise,
|
|
501
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
502
|
+
});
|
|
491
503
|
}
|
|
492
504
|
/**
|
|
493
505
|
*
|
|
@@ -500,15 +512,15 @@ var ServerListenEventError = class {
|
|
|
500
512
|
this.stackTrace = this.traceError(
|
|
501
513
|
import_opticore_translator2.TranslationLoader.t(error.message, this.localeLanguage, { error: error.stack }),
|
|
502
514
|
import_opticore_translator2.TranslationLoader.t("uncaughtExceptionHandled", this.localeLanguage),
|
|
503
|
-
|
|
504
|
-
);
|
|
505
|
-
this.logger.error(
|
|
506
|
-
this.stackTrace.message,
|
|
507
|
-
"UncaughtException",
|
|
508
|
-
this.stackTrace.name,
|
|
509
|
-
error.stack,
|
|
510
|
-
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
515
|
+
import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
511
516
|
);
|
|
517
|
+
this.logger.error({
|
|
518
|
+
message: this.stackTrace.message,
|
|
519
|
+
title: "UncaughtException",
|
|
520
|
+
errorType: this.stackTrace.name,
|
|
521
|
+
stackTrace: error.stack,
|
|
522
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
523
|
+
});
|
|
512
524
|
}
|
|
513
525
|
}
|
|
514
526
|
/**
|
|
@@ -529,33 +541,29 @@ var ServerListenEventError = class {
|
|
|
529
541
|
this.stackTrace = this.traceError(
|
|
530
542
|
import_opticore_translator2.TranslationLoader.t("unhandledRejectionAtPromise", this.localeLanguage, { promise, reason }),
|
|
531
543
|
import_opticore_translator2.TranslationLoader.t("unhandledRejection", this.localeLanguage, { promise, reason }),
|
|
532
|
-
|
|
533
|
-
);
|
|
534
|
-
this.logger.error(
|
|
535
|
-
this.stackTrace.message,
|
|
536
|
-
"UnhandledRejection",
|
|
537
|
-
this.stackTrace.name,
|
|
538
|
-
`reason: ${reason} - promise: ${promise}`,
|
|
539
|
-
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
544
|
+
import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
540
545
|
);
|
|
546
|
+
this.logger.error({
|
|
547
|
+
message: this.stackTrace.message,
|
|
548
|
+
title: "UnhandledRejection",
|
|
549
|
+
errorType: this.stackTrace.name,
|
|
550
|
+
stackTrace: `reason: ${reason} - promise: ${promise}`,
|
|
551
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
552
|
+
});
|
|
541
553
|
}
|
|
542
554
|
/**
|
|
543
555
|
*
|
|
544
556
|
* @param warning
|
|
545
557
|
*/
|
|
546
558
|
warning(warning) {
|
|
547
|
-
this.stackTrace = this.traceError(
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
this.stackTrace.name,
|
|
556
|
-
`warning: ${warning}`,
|
|
557
|
-
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
558
|
-
);
|
|
559
|
+
this.stackTrace = this.traceError(import_opticore_translator2.TranslationLoader.t(warning.message, this.localeLanguage), "warning", import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE);
|
|
560
|
+
this.logger.error({
|
|
561
|
+
message: this.stackTrace.message,
|
|
562
|
+
title: import_opticore_translator2.TranslationLoader.t("warning", this.localeLanguage, { warning }),
|
|
563
|
+
errorType: this.stackTrace.name,
|
|
564
|
+
stackTrace: `warning: ${warning}`,
|
|
565
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
566
|
+
});
|
|
559
567
|
}
|
|
560
568
|
/**
|
|
561
569
|
*
|
|
@@ -565,15 +573,15 @@ var ServerListenEventError = class {
|
|
|
565
573
|
this.stackTrace = this.traceError(
|
|
566
574
|
import_opticore_translator2.TranslationLoader.t("processGotMsg", this.localeLanguage, { message }),
|
|
567
575
|
import_opticore_translator2.TranslationLoader.t("msgException", this.localeLanguage, { message }),
|
|
568
|
-
|
|
569
|
-
);
|
|
570
|
-
this.logger.error(
|
|
571
|
-
this.stackTrace.message,
|
|
572
|
-
"Message",
|
|
573
|
-
this.stackTrace.name,
|
|
574
|
-
`message: ${message}`,
|
|
575
|
-
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
576
|
+
import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
576
577
|
);
|
|
578
|
+
this.logger.error({
|
|
579
|
+
message: this.stackTrace.message,
|
|
580
|
+
title: "Message",
|
|
581
|
+
errorType: this.stackTrace.name,
|
|
582
|
+
stackTrace: `message: ${message}`,
|
|
583
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
584
|
+
});
|
|
577
585
|
}
|
|
578
586
|
/**
|
|
579
587
|
*
|
|
@@ -585,24 +593,24 @@ var ServerListenEventError = class {
|
|
|
585
593
|
this.stackTrace = this.traceError(
|
|
586
594
|
import_opticore_translator2.TranslationLoader.t("promiseReason", this.localeLanguage, { promise, reason }),
|
|
587
595
|
import_opticore_translator2.TranslationLoader.t("multipleResolvesDetected", this.localeLanguage, { type, promise, reason }),
|
|
588
|
-
|
|
589
|
-
);
|
|
590
|
-
this.logger.error(
|
|
591
|
-
this.stackTrace.message,
|
|
592
|
-
"multipleResolves",
|
|
593
|
-
this.stackTrace.name,
|
|
594
|
-
`type: ${type}, promise: ${promise}, reason: ${reason}`,
|
|
595
|
-
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
596
|
+
import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
596
597
|
);
|
|
598
|
+
this.logger.error({
|
|
599
|
+
message: this.stackTrace.message,
|
|
600
|
+
title: "multipleResolves",
|
|
601
|
+
errorType: this.stackTrace.name,
|
|
602
|
+
stackTrace: `type: ${type}, promise: ${promise}, reason: ${reason}`,
|
|
603
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
604
|
+
});
|
|
597
605
|
}
|
|
598
606
|
/**
|
|
599
607
|
*
|
|
600
608
|
*/
|
|
601
609
|
processInterrupted() {
|
|
602
|
-
this.logger.success(
|
|
603
|
-
import_opticore_translator2.TranslationLoader.t("okSuccess", this.localeLanguage),
|
|
604
|
-
import_opticore_translator2.TranslationLoader.t("serverWebStopped", this.localeLanguage)
|
|
605
|
-
);
|
|
610
|
+
this.logger.success({
|
|
611
|
+
title: import_opticore_translator2.TranslationLoader.t("okSuccess", this.localeLanguage),
|
|
612
|
+
message: import_opticore_translator2.TranslationLoader.t("serverWebStopped", this.localeLanguage)
|
|
613
|
+
});
|
|
606
614
|
import_process.default.exit(0);
|
|
607
615
|
}
|
|
608
616
|
/**
|
|
@@ -613,30 +621,48 @@ var ServerListenEventError = class {
|
|
|
613
621
|
this.stackTrace = this.traceError(
|
|
614
622
|
import_opticore_translator2.TranslationLoader.t("processPIDReceivedSignal", this.localeLanguage, { signal: signal.toString() }),
|
|
615
623
|
"SIGTERM",
|
|
616
|
-
|
|
617
|
-
);
|
|
618
|
-
this.logger.error(
|
|
619
|
-
this.stackTrace.message,
|
|
620
|
-
"SIGTERM",
|
|
621
|
-
this.stackTrace.name,
|
|
622
|
-
signal.toString(),
|
|
623
|
-
import_opticore_http_response.HttpStatusCode.NOT_ACCEPTABLE
|
|
624
|
+
import_opticore_http_response2.HttpStatusCode.NOT_ACCEPTABLE
|
|
624
625
|
);
|
|
626
|
+
this.logger.error({
|
|
627
|
+
message: this.stackTrace.message,
|
|
628
|
+
title: "SIGTERM",
|
|
629
|
+
errorType: this.stackTrace.name,
|
|
630
|
+
stackTrace: signal.toString(),
|
|
631
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.NOT_ACCEPTABLE
|
|
632
|
+
});
|
|
625
633
|
import_process.default.exit(0);
|
|
626
634
|
}
|
|
627
635
|
/**
|
|
628
636
|
*
|
|
629
637
|
*/
|
|
630
638
|
serverClosing() {
|
|
631
|
-
|
|
632
|
-
|
|
639
|
+
this.serverLogger.opticoreLog({
|
|
640
|
+
timestamp: dateTimeFormatted,
|
|
641
|
+
level: "OPTICORE",
|
|
642
|
+
title: "Stop",
|
|
643
|
+
typeName: "Process stopped",
|
|
644
|
+
message: import_opticore_translator2.TranslationLoader.t("allProcessStopped", this.localeLanguage)
|
|
645
|
+
});
|
|
646
|
+
this.serverLogger.serverLog({
|
|
647
|
+
timestamp: dateTimeFormatted,
|
|
648
|
+
level: "SERVER",
|
|
649
|
+
title: "Ending",
|
|
650
|
+
typeName: "Server ending",
|
|
651
|
+
message: import_opticore_translator2.TranslationLoader.t("serverClosed", this.localeLanguage)
|
|
652
|
+
});
|
|
633
653
|
import_process.default.exit();
|
|
634
654
|
}
|
|
635
655
|
/**
|
|
636
656
|
*
|
|
637
657
|
*/
|
|
638
658
|
dropNewConnection() {
|
|
639
|
-
|
|
659
|
+
this.serverLogger.serverLog({
|
|
660
|
+
timestamp: dateTimeFormatted,
|
|
661
|
+
level: "SERVER",
|
|
662
|
+
title: "Dropped connection",
|
|
663
|
+
typeName: import_opticore_translator2.TranslationLoader.t("serverMaxCon", this.localeLanguage),
|
|
664
|
+
message: import_opticore_translator2.TranslationLoader.t("serverDroppedCon", this.localeLanguage)
|
|
665
|
+
});
|
|
640
666
|
}
|
|
641
667
|
/**
|
|
642
668
|
*
|
|
@@ -652,26 +678,26 @@ var ServerListenEventError = class {
|
|
|
652
678
|
if (typeof res.status === "function") {
|
|
653
679
|
res.status(500).send(import_opticore_translator2.TranslationLoader.t("internalServerError", this.localeLanguage, { err }));
|
|
654
680
|
} else {
|
|
655
|
-
this.logger.error(
|
|
656
|
-
import_opticore_translator2.TranslationLoader.t("resStatusNotFunc", this.localeLanguage, { err }),
|
|
657
|
-
"response status",
|
|
658
|
-
import_opticore_translator2.TranslationLoader.t("respndNotFunc", this.localeLanguage, { err }),
|
|
659
|
-
err.stack,
|
|
660
|
-
|
|
661
|
-
);
|
|
681
|
+
this.logger.error({
|
|
682
|
+
message: import_opticore_translator2.TranslationLoader.t("resStatusNotFunc", this.localeLanguage, { err }),
|
|
683
|
+
title: "response status",
|
|
684
|
+
errorType: import_opticore_translator2.TranslationLoader.t("respndNotFunc", this.localeLanguage, { err }),
|
|
685
|
+
stackTrace: err.stack,
|
|
686
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.NOT_ACCEPTABLE
|
|
687
|
+
});
|
|
662
688
|
}
|
|
663
689
|
this.stackTrace = this.traceError(
|
|
664
690
|
err.message,
|
|
665
691
|
import_opticore_translator2.TranslationLoader.t("expressError", this.localeLanguage, { err }),
|
|
666
|
-
|
|
667
|
-
);
|
|
668
|
-
this.logger.error(
|
|
669
|
-
this.stackTrace.message,
|
|
670
|
-
import_opticore_translator2.TranslationLoader.t("expressErrorHandlingMiddleware", this.localeLanguage, { err }),
|
|
671
|
-
this.stackTrace.name,
|
|
672
|
-
err.stack,
|
|
673
|
-
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
692
|
+
import_opticore_http_response2.HttpStatusCode.NOT_ACCEPTABLE
|
|
674
693
|
);
|
|
694
|
+
this.logger.error({
|
|
695
|
+
message: this.stackTrace.message,
|
|
696
|
+
title: import_opticore_translator2.TranslationLoader.t("expressErrorHandlingMiddleware", this.localeLanguage, { err }),
|
|
697
|
+
errorType: this.stackTrace.name,
|
|
698
|
+
stackTrace: err.stack,
|
|
699
|
+
httpCodeValue: import_opticore_http_response2.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
700
|
+
});
|
|
675
701
|
} else {
|
|
676
702
|
next();
|
|
677
703
|
}
|
|
@@ -682,85 +708,85 @@ var ServerListenEventError = class {
|
|
|
682
708
|
};
|
|
683
709
|
|
|
684
710
|
// src/core/errors/javaScript/javaScriptErrors.ts
|
|
685
|
-
var
|
|
686
|
-
var
|
|
711
|
+
var import_opticore_logger3 = require("opticore-logger");
|
|
712
|
+
var import_opticore_http_response3 = require("opticore-http-response");
|
|
687
713
|
var import_opticore_translator3 = require("opticore-translator");
|
|
688
714
|
var JavaScriptErrors = class {
|
|
689
|
-
logger = new
|
|
715
|
+
logger = new import_opticore_logger3.LoggerCore();
|
|
690
716
|
stackTrace;
|
|
691
717
|
localLanguage;
|
|
692
718
|
constructor(defaultLocalLang) {
|
|
693
719
|
this.localLanguage = defaultLocalLang;
|
|
694
720
|
}
|
|
695
721
|
allError(error) {
|
|
696
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
697
|
-
this.logger.error(
|
|
698
|
-
import_opticore_translator3.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
699
|
-
"Error",
|
|
700
|
-
this.stackTrace.name,
|
|
701
|
-
error.stack,
|
|
702
|
-
|
|
703
|
-
);
|
|
722
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
723
|
+
this.logger.error({
|
|
724
|
+
message: import_opticore_translator3.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
725
|
+
title: "Error",
|
|
726
|
+
errorType: this.stackTrace.name,
|
|
727
|
+
stackTrace: error.stack,
|
|
728
|
+
httpCodeValue: import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
729
|
+
});
|
|
704
730
|
}
|
|
705
731
|
evalError(error) {
|
|
706
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
707
|
-
this.logger.error(
|
|
708
|
-
import_opticore_translator3.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
709
|
-
"EvalError",
|
|
710
|
-
this.stackTrace.name,
|
|
711
|
-
error.stack,
|
|
712
|
-
|
|
713
|
-
);
|
|
732
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
733
|
+
this.logger.error({
|
|
734
|
+
message: import_opticore_translator3.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
735
|
+
title: "EvalError",
|
|
736
|
+
errorType: this.stackTrace.name,
|
|
737
|
+
stackTrace: error.stack,
|
|
738
|
+
httpCodeValue: import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
739
|
+
});
|
|
714
740
|
}
|
|
715
741
|
rangeError(error) {
|
|
716
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
717
|
-
this.logger.error(
|
|
718
|
-
import_opticore_translator3.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
719
|
-
"RangeError",
|
|
720
|
-
this.stackTrace.name,
|
|
721
|
-
error.stack,
|
|
722
|
-
|
|
723
|
-
);
|
|
742
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
743
|
+
this.logger.error({
|
|
744
|
+
message: import_opticore_translator3.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
745
|
+
title: "RangeError",
|
|
746
|
+
errorType: this.stackTrace.name,
|
|
747
|
+
stackTrace: error.stack,
|
|
748
|
+
httpCodeValue: import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
749
|
+
});
|
|
724
750
|
}
|
|
725
751
|
referenceError(error) {
|
|
726
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
727
|
-
this.logger.error(
|
|
728
|
-
import_opticore_translator3.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
729
|
-
"ReferenceError",
|
|
730
|
-
this.stackTrace.name,
|
|
731
|
-
error.stack,
|
|
732
|
-
|
|
733
|
-
);
|
|
752
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
753
|
+
this.logger.error({
|
|
754
|
+
message: import_opticore_translator3.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
755
|
+
title: "ReferenceError",
|
|
756
|
+
errorType: this.stackTrace.name,
|
|
757
|
+
stackTrace: error.stack,
|
|
758
|
+
httpCodeValue: import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
759
|
+
});
|
|
734
760
|
}
|
|
735
761
|
syntaxError(error) {
|
|
736
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
737
|
-
this.logger.error(
|
|
738
|
-
import_opticore_translator3.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
739
|
-
"SyntaxError",
|
|
740
|
-
this.stackTrace.name,
|
|
741
|
-
error.stack,
|
|
742
|
-
|
|
743
|
-
);
|
|
762
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
763
|
+
this.logger.error({
|
|
764
|
+
message: import_opticore_translator3.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
765
|
+
title: "SyntaxError",
|
|
766
|
+
errorType: this.stackTrace.name,
|
|
767
|
+
stackTrace: error.stack,
|
|
768
|
+
httpCodeValue: import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
769
|
+
});
|
|
744
770
|
}
|
|
745
771
|
typeError(error) {
|
|
746
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
747
|
-
this.logger.error(
|
|
748
|
-
import_opticore_translator3.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
749
|
-
"TypeError",
|
|
750
|
-
this.stackTrace.name,
|
|
751
|
-
error.stack,
|
|
752
|
-
|
|
753
|
-
);
|
|
772
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
773
|
+
this.logger.error({
|
|
774
|
+
message: import_opticore_translator3.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
775
|
+
title: "TypeError",
|
|
776
|
+
errorType: this.stackTrace.name,
|
|
777
|
+
stackTrace: error.stack,
|
|
778
|
+
httpCodeValue: import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
779
|
+
});
|
|
754
780
|
}
|
|
755
781
|
uRIError(error) {
|
|
756
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
757
|
-
this.logger.error(
|
|
758
|
-
import_opticore_translator3.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
759
|
-
"URIError",
|
|
760
|
-
this.stackTrace.name,
|
|
761
|
-
error.stack,
|
|
762
|
-
|
|
763
|
-
);
|
|
782
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
783
|
+
this.logger.error({
|
|
784
|
+
message: import_opticore_translator3.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
785
|
+
title: "URIError",
|
|
786
|
+
errorType: this.stackTrace.name,
|
|
787
|
+
stackTrace: error.stack,
|
|
788
|
+
httpCodeValue: import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
789
|
+
});
|
|
764
790
|
}
|
|
765
791
|
traceError(props, name, status7) {
|
|
766
792
|
return new StackTraceError(props, name, status7, true);
|
|
@@ -768,145 +794,145 @@ var JavaScriptErrors = class {
|
|
|
768
794
|
};
|
|
769
795
|
|
|
770
796
|
// src/core/errors/system/systemErrors.ts
|
|
771
|
-
var
|
|
772
|
-
var
|
|
797
|
+
var import_opticore_logger4 = require("opticore-logger");
|
|
798
|
+
var import_opticore_http_response4 = require("opticore-http-response");
|
|
773
799
|
var import_opticore_translator4 = require("opticore-translator");
|
|
774
800
|
var SystemErrors = class {
|
|
775
|
-
logger = new
|
|
801
|
+
logger = new import_opticore_logger4.LoggerCore();
|
|
776
802
|
stackTrace;
|
|
777
803
|
localLanguage;
|
|
778
804
|
constructor(defaultLocalLang) {
|
|
779
805
|
this.localLanguage = defaultLocalLang;
|
|
780
806
|
}
|
|
781
807
|
eAcces(error) {
|
|
782
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
783
|
-
this.logger.error(
|
|
784
|
-
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
785
|
-
"EACCES",
|
|
786
|
-
this.stackTrace.name,
|
|
787
|
-
error.stack,
|
|
788
|
-
|
|
789
|
-
);
|
|
808
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
809
|
+
this.logger.error({
|
|
810
|
+
message: import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
811
|
+
title: "EACCES",
|
|
812
|
+
errorType: this.stackTrace.name,
|
|
813
|
+
stackTrace: error.stack,
|
|
814
|
+
httpCodeValue: import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
815
|
+
});
|
|
790
816
|
}
|
|
791
817
|
eAddrInUse(error) {
|
|
792
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
793
|
-
this.logger.error(
|
|
794
|
-
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
795
|
-
"EADDRINUSE",
|
|
796
|
-
this.stackTrace.name,
|
|
797
|
-
error.stack,
|
|
798
|
-
|
|
799
|
-
);
|
|
818
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
819
|
+
this.logger.error({
|
|
820
|
+
message: import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
821
|
+
title: "EADDRINUSE",
|
|
822
|
+
errorType: this.stackTrace.name,
|
|
823
|
+
stackTrace: error.stack,
|
|
824
|
+
httpCodeValue: import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
825
|
+
});
|
|
800
826
|
}
|
|
801
827
|
eConnRefused(error) {
|
|
802
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
803
|
-
this.logger.error(
|
|
804
|
-
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
805
|
-
"ECONNREFUSED",
|
|
806
|
-
this.stackTrace.name,
|
|
807
|
-
error.stack,
|
|
808
|
-
|
|
809
|
-
);
|
|
828
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
829
|
+
this.logger.error({
|
|
830
|
+
message: import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
831
|
+
title: "ECONNREFUSED",
|
|
832
|
+
errorType: this.stackTrace.name,
|
|
833
|
+
stackTrace: error.stack,
|
|
834
|
+
httpCodeValue: import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
835
|
+
});
|
|
810
836
|
}
|
|
811
837
|
eConnReset(error) {
|
|
812
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
813
|
-
this.logger.error(
|
|
814
|
-
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
815
|
-
"ECONNRESET",
|
|
816
|
-
this.stackTrace.name,
|
|
817
|
-
error.stack,
|
|
818
|
-
|
|
819
|
-
);
|
|
838
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
839
|
+
this.logger.error({
|
|
840
|
+
message: import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
841
|
+
title: "ECONNRESET",
|
|
842
|
+
errorType: this.stackTrace.name,
|
|
843
|
+
stackTrace: error.stack,
|
|
844
|
+
httpCodeValue: import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
845
|
+
});
|
|
820
846
|
}
|
|
821
847
|
eExist(error) {
|
|
822
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
823
|
-
this.logger.error(
|
|
824
|
-
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
825
|
-
"EEXIST",
|
|
826
|
-
this.stackTrace.name,
|
|
827
|
-
error.stack,
|
|
828
|
-
|
|
829
|
-
);
|
|
848
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
849
|
+
this.logger.error({
|
|
850
|
+
message: import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
851
|
+
title: "EEXIST",
|
|
852
|
+
errorType: this.stackTrace.name,
|
|
853
|
+
stackTrace: error.stack,
|
|
854
|
+
httpCodeValue: import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
855
|
+
});
|
|
830
856
|
}
|
|
831
857
|
eIsDir(error) {
|
|
832
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
833
|
-
this.logger.error(
|
|
834
|
-
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
835
|
-
"EISDIR",
|
|
836
|
-
this.stackTrace.name,
|
|
837
|
-
error.stack,
|
|
838
|
-
|
|
839
|
-
);
|
|
858
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
859
|
+
this.logger.error({
|
|
860
|
+
message: import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
861
|
+
title: "EISDIR",
|
|
862
|
+
errorType: this.stackTrace.name,
|
|
863
|
+
stackTrace: error.stack,
|
|
864
|
+
httpCodeValue: import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
865
|
+
});
|
|
840
866
|
}
|
|
841
867
|
eMFile(error) {
|
|
842
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
843
|
-
this.logger.error(
|
|
844
|
-
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
845
|
-
"EMFILE",
|
|
846
|
-
this.stackTrace.name,
|
|
847
|
-
error.stack,
|
|
848
|
-
|
|
849
|
-
);
|
|
868
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
869
|
+
this.logger.error({
|
|
870
|
+
message: import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
871
|
+
title: "EMFILE",
|
|
872
|
+
errorType: this.stackTrace.name,
|
|
873
|
+
stackTrace: error.stack,
|
|
874
|
+
httpCodeValue: import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
875
|
+
});
|
|
850
876
|
}
|
|
851
877
|
eNoEnt(error) {
|
|
852
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
853
|
-
this.logger.error(
|
|
854
|
-
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
855
|
-
"ENOENT",
|
|
856
|
-
this.stackTrace.name,
|
|
857
|
-
error.stack,
|
|
858
|
-
|
|
859
|
-
);
|
|
878
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
879
|
+
this.logger.error({
|
|
880
|
+
message: import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
881
|
+
title: "ENOENT",
|
|
882
|
+
errorType: this.stackTrace.name,
|
|
883
|
+
stackTrace: error.stack,
|
|
884
|
+
httpCodeValue: import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
885
|
+
});
|
|
860
886
|
}
|
|
861
887
|
eNotDir(error) {
|
|
862
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
863
|
-
this.logger.error(
|
|
864
|
-
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
865
|
-
"ENOTDIR",
|
|
866
|
-
this.stackTrace.name,
|
|
867
|
-
error.stack,
|
|
868
|
-
|
|
869
|
-
);
|
|
888
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
889
|
+
this.logger.error({
|
|
890
|
+
message: import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
891
|
+
title: "ENOTDIR",
|
|
892
|
+
errorType: this.stackTrace.name,
|
|
893
|
+
stackTrace: error.stack,
|
|
894
|
+
httpCodeValue: import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
895
|
+
});
|
|
870
896
|
}
|
|
871
897
|
eNotEmpty(error) {
|
|
872
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
873
|
-
this.logger.error(
|
|
874
|
-
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
875
|
-
"ENOTEMPTY",
|
|
876
|
-
this.stackTrace.name,
|
|
877
|
-
error.stack,
|
|
878
|
-
|
|
879
|
-
);
|
|
898
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
899
|
+
this.logger.error({
|
|
900
|
+
message: import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
901
|
+
title: "ENOTEMPTY",
|
|
902
|
+
errorType: this.stackTrace.name,
|
|
903
|
+
stackTrace: error.stack,
|
|
904
|
+
httpCodeValue: import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
905
|
+
});
|
|
880
906
|
}
|
|
881
907
|
ePerm(error) {
|
|
882
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
883
|
-
this.logger.error(
|
|
884
|
-
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
885
|
-
"EPERM",
|
|
886
|
-
this.stackTrace.name,
|
|
887
|
-
error.stack,
|
|
888
|
-
|
|
889
|
-
);
|
|
908
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
909
|
+
this.logger.error({
|
|
910
|
+
message: import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
911
|
+
title: "EPERM",
|
|
912
|
+
errorType: this.stackTrace.name,
|
|
913
|
+
stackTrace: error.stack,
|
|
914
|
+
httpCodeValue: import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
915
|
+
});
|
|
890
916
|
}
|
|
891
917
|
ePipe(error) {
|
|
892
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
893
|
-
this.logger.error(
|
|
894
|
-
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
895
|
-
"EPIPE",
|
|
896
|
-
this.stackTrace.name,
|
|
897
|
-
error.stack,
|
|
898
|
-
|
|
899
|
-
);
|
|
918
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
919
|
+
this.logger.error({
|
|
920
|
+
message: import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
921
|
+
title: "EPIPE",
|
|
922
|
+
errorType: this.stackTrace.name,
|
|
923
|
+
stackTrace: error.stack,
|
|
924
|
+
httpCodeValue: import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
925
|
+
});
|
|
900
926
|
}
|
|
901
927
|
eTimedOut(error) {
|
|
902
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
903
|
-
this.logger.error(
|
|
904
|
-
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
905
|
-
"ETIMEDOUT",
|
|
906
|
-
this.stackTrace.name,
|
|
907
|
-
error.stack,
|
|
908
|
-
|
|
909
|
-
);
|
|
928
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
929
|
+
this.logger.error({
|
|
930
|
+
message: import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
931
|
+
title: "ETIMEDOUT",
|
|
932
|
+
errorType: this.stackTrace.name,
|
|
933
|
+
stackTrace: error.stack,
|
|
934
|
+
httpCodeValue: import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
935
|
+
});
|
|
910
936
|
}
|
|
911
937
|
traceError(props, name, status7) {
|
|
912
938
|
return new StackTraceError(props, name, status7, true);
|
|
@@ -914,45 +940,45 @@ var SystemErrors = class {
|
|
|
914
940
|
};
|
|
915
941
|
|
|
916
942
|
// src/core/errors/openSSL/openSSLErrors.ts
|
|
917
|
-
var
|
|
918
|
-
var
|
|
943
|
+
var import_opticore_logger5 = require("opticore-logger");
|
|
944
|
+
var import_opticore_http_response5 = require("opticore-http-response");
|
|
919
945
|
var import_opticore_translator5 = require("opticore-translator");
|
|
920
946
|
var OpenSSLErrors = class {
|
|
921
|
-
logger = new
|
|
947
|
+
logger = new import_opticore_logger5.LoggerCore();
|
|
922
948
|
stackTrace;
|
|
923
949
|
localLanguage;
|
|
924
950
|
constructor(defaultLocalLang) {
|
|
925
951
|
this.localLanguage = defaultLocalLang;
|
|
926
952
|
}
|
|
927
953
|
errOsSLEvpUnsupported(error) {
|
|
928
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
929
|
-
this.logger.error(
|
|
930
|
-
import_opticore_translator5.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
931
|
-
"ERR_OSSL_EVP_UNSUPPORTED",
|
|
932
|
-
this.stackTrace.name,
|
|
933
|
-
error.stack,
|
|
934
|
-
|
|
935
|
-
);
|
|
954
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response5.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
955
|
+
this.logger.error({
|
|
956
|
+
message: import_opticore_translator5.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
957
|
+
title: "ERR_OSSL_EVP_UNSUPPORTED",
|
|
958
|
+
errorType: this.stackTrace.name,
|
|
959
|
+
stackTrace: error.stack,
|
|
960
|
+
httpCodeValue: import_opticore_http_response5.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
961
|
+
});
|
|
936
962
|
}
|
|
937
963
|
errOsSLBadDecrypt(error) {
|
|
938
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
939
|
-
this.logger.error(
|
|
940
|
-
import_opticore_translator5.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
941
|
-
"ERR_OSSL_BAD_DECRYPT",
|
|
942
|
-
this.stackTrace.name,
|
|
943
|
-
error.stack,
|
|
944
|
-
|
|
945
|
-
);
|
|
964
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response5.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
965
|
+
this.logger.error({
|
|
966
|
+
message: import_opticore_translator5.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
967
|
+
title: "ERR_OSSL_BAD_DECRYPT",
|
|
968
|
+
errorType: this.stackTrace.name,
|
|
969
|
+
stackTrace: error.stack,
|
|
970
|
+
httpCodeValue: import_opticore_http_response5.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
971
|
+
});
|
|
946
972
|
}
|
|
947
973
|
errOsSLWrongFinalBlockLength(error) {
|
|
948
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
949
|
-
this.logger.error(
|
|
950
|
-
import_opticore_translator5.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
951
|
-
"ERR_OSSL_WRONG_FINAL_BLOCK_LENGTH",
|
|
952
|
-
this.stackTrace.name,
|
|
953
|
-
error.stack,
|
|
954
|
-
|
|
955
|
-
);
|
|
974
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response5.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
975
|
+
this.logger.error({
|
|
976
|
+
message: import_opticore_translator5.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
977
|
+
title: "ERR_OSSL_WRONG_FINAL_BLOCK_LENGTH",
|
|
978
|
+
errorType: this.stackTrace.name,
|
|
979
|
+
stackTrace: error.stack,
|
|
980
|
+
httpCodeValue: import_opticore_http_response5.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
981
|
+
});
|
|
956
982
|
}
|
|
957
983
|
traceError(props, name, status7) {
|
|
958
984
|
return new StackTraceError(props, name, status7, true);
|
|
@@ -960,75 +986,75 @@ var OpenSSLErrors = class {
|
|
|
960
986
|
};
|
|
961
987
|
|
|
962
988
|
// src/core/errors/internal/internalErrors.ts
|
|
963
|
-
var
|
|
964
|
-
var
|
|
989
|
+
var import_opticore_logger6 = require("opticore-logger");
|
|
990
|
+
var import_opticore_http_response6 = require("opticore-http-response");
|
|
965
991
|
var import_opticore_translator6 = require("opticore-translator");
|
|
966
992
|
var InternalErrors = class {
|
|
967
|
-
logger = new
|
|
993
|
+
logger = new import_opticore_logger6.LoggerCore();
|
|
968
994
|
stackTrace;
|
|
969
995
|
localLanguage;
|
|
970
996
|
constructor(defaultLocalLang) {
|
|
971
997
|
this.localLanguage = defaultLocalLang;
|
|
972
998
|
}
|
|
973
999
|
errInvalidArgType(error) {
|
|
974
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
975
|
-
this.logger.error(
|
|
976
|
-
import_opticore_translator6.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
977
|
-
"ERR_INVALID_ARG_TYPE",
|
|
978
|
-
this.stackTrace.name,
|
|
979
|
-
error.stack,
|
|
980
|
-
|
|
981
|
-
);
|
|
1000
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
1001
|
+
this.logger.error({
|
|
1002
|
+
message: import_opticore_translator6.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1003
|
+
title: "ERR_INVALID_ARG_TYPE",
|
|
1004
|
+
errorType: this.stackTrace.name,
|
|
1005
|
+
stackTrace: error.stack,
|
|
1006
|
+
httpCodeValue: import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1007
|
+
});
|
|
982
1008
|
}
|
|
983
1009
|
errInvalidCallback(error) {
|
|
984
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
985
|
-
this.logger.error(
|
|
986
|
-
import_opticore_translator6.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
987
|
-
"ERR_INVALID_CALLBACK",
|
|
988
|
-
this.stackTrace.name,
|
|
989
|
-
error.stack,
|
|
990
|
-
|
|
991
|
-
);
|
|
1010
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
1011
|
+
this.logger.error({
|
|
1012
|
+
message: import_opticore_translator6.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1013
|
+
title: "ERR_INVALID_CALLBACK",
|
|
1014
|
+
errorType: this.stackTrace.name,
|
|
1015
|
+
stackTrace: error.stack,
|
|
1016
|
+
httpCodeValue: import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1017
|
+
});
|
|
992
1018
|
}
|
|
993
1019
|
errHttpHeadersSent(error) {
|
|
994
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
995
|
-
this.logger.error(
|
|
996
|
-
import_opticore_translator6.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
997
|
-
"ERR_HTTP_HEADERS_SENT",
|
|
998
|
-
this.stackTrace.name,
|
|
999
|
-
error.stack,
|
|
1000
|
-
|
|
1001
|
-
);
|
|
1020
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
1021
|
+
this.logger.error({
|
|
1022
|
+
message: import_opticore_translator6.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1023
|
+
title: "ERR_HTTP_HEADERS_SENT",
|
|
1024
|
+
errorType: this.stackTrace.name,
|
|
1025
|
+
stackTrace: error.stack,
|
|
1026
|
+
httpCodeValue: import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1027
|
+
});
|
|
1002
1028
|
}
|
|
1003
1029
|
errStreamDestroyed(error) {
|
|
1004
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
1005
|
-
this.logger.error(
|
|
1006
|
-
import_opticore_translator6.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1007
|
-
"ERR_STREAM_DESTROYED",
|
|
1008
|
-
this.stackTrace.name,
|
|
1009
|
-
error.stack,
|
|
1010
|
-
|
|
1011
|
-
);
|
|
1030
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
1031
|
+
this.logger.error({
|
|
1032
|
+
message: import_opticore_translator6.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1033
|
+
title: "ERR_STREAM_DESTROYED",
|
|
1034
|
+
errorType: this.stackTrace.name,
|
|
1035
|
+
stackTrace: error.stack,
|
|
1036
|
+
httpCodeValue: import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1037
|
+
});
|
|
1012
1038
|
}
|
|
1013
1039
|
errTlsCertAltNameInvalid(error) {
|
|
1014
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
1015
|
-
this.logger.error(
|
|
1016
|
-
import_opticore_translator6.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1017
|
-
"ERR_TLS_CERT_ALTNAME_INVALID",
|
|
1018
|
-
this.stackTrace.name,
|
|
1019
|
-
error.stack,
|
|
1020
|
-
|
|
1021
|
-
);
|
|
1040
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
1041
|
+
this.logger.error({
|
|
1042
|
+
message: import_opticore_translator6.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1043
|
+
title: "ERR_TLS_CERT_ALTNAME_INVALID",
|
|
1044
|
+
errorType: this.stackTrace.name,
|
|
1045
|
+
stackTrace: error.stack,
|
|
1046
|
+
httpCodeValue: import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1047
|
+
});
|
|
1022
1048
|
}
|
|
1023
1049
|
errUnsupportedEsmUrlScheme(error) {
|
|
1024
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
1025
|
-
this.logger.error(
|
|
1026
|
-
import_opticore_translator6.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1027
|
-
"ERR_UNSUPPORTED_ESM_URL_SCHEME",
|
|
1028
|
-
this.stackTrace.name,
|
|
1029
|
-
error.stack,
|
|
1030
|
-
|
|
1031
|
-
);
|
|
1050
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
1051
|
+
this.logger.error({
|
|
1052
|
+
message: import_opticore_translator6.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1053
|
+
title: "ERR_UNSUPPORTED_ESM_URL_SCHEME",
|
|
1054
|
+
errorType: this.stackTrace.name,
|
|
1055
|
+
stackTrace: error.stack,
|
|
1056
|
+
httpCodeValue: import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1057
|
+
});
|
|
1032
1058
|
}
|
|
1033
1059
|
traceError(props, name, status7) {
|
|
1034
1060
|
return new StackTraceError(props, name, status7, true);
|
|
@@ -1036,95 +1062,95 @@ var InternalErrors = class {
|
|
|
1036
1062
|
};
|
|
1037
1063
|
|
|
1038
1064
|
// src/core/errors/assertion/assertionErrors.ts
|
|
1039
|
-
var
|
|
1040
|
-
var
|
|
1065
|
+
var import_opticore_logger7 = require("opticore-logger");
|
|
1066
|
+
var import_opticore_http_response7 = require("opticore-http-response");
|
|
1041
1067
|
var import_opticore_translator7 = require("opticore-translator");
|
|
1042
1068
|
var AssertionErrors = class {
|
|
1043
|
-
logger = new
|
|
1069
|
+
logger = new import_opticore_logger7.LoggerCore();
|
|
1044
1070
|
stackTrace;
|
|
1045
1071
|
localLanguage;
|
|
1046
1072
|
constructor(defaultLocalLang) {
|
|
1047
1073
|
this.localLanguage = defaultLocalLang;
|
|
1048
1074
|
}
|
|
1049
1075
|
assertionError(error) {
|
|
1050
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
1051
|
-
this.logger.error(
|
|
1052
|
-
import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1053
|
-
"AssertionError",
|
|
1054
|
-
this.stackTrace.name,
|
|
1055
|
-
error.stack,
|
|
1056
|
-
|
|
1057
|
-
);
|
|
1076
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response7.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
1077
|
+
this.logger.error({
|
|
1078
|
+
message: import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1079
|
+
title: "AssertionError",
|
|
1080
|
+
errorType: this.stackTrace.name,
|
|
1081
|
+
stackTrace: error.stack,
|
|
1082
|
+
httpCodeValue: import_opticore_http_response7.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1083
|
+
});
|
|
1058
1084
|
}
|
|
1059
1085
|
allError(error) {
|
|
1060
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
1061
|
-
this.logger.error(
|
|
1062
|
-
import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1063
|
-
"Error",
|
|
1064
|
-
this.stackTrace.name,
|
|
1065
|
-
error.stack,
|
|
1066
|
-
|
|
1067
|
-
);
|
|
1086
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response7.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
1087
|
+
this.logger.error({
|
|
1088
|
+
message: import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1089
|
+
title: "Error",
|
|
1090
|
+
errorType: this.stackTrace.name,
|
|
1091
|
+
stackTrace: error.stack,
|
|
1092
|
+
httpCodeValue: import_opticore_http_response7.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1093
|
+
});
|
|
1068
1094
|
}
|
|
1069
1095
|
evalError(error) {
|
|
1070
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
1071
|
-
this.logger.error(
|
|
1072
|
-
import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1073
|
-
"EvalError",
|
|
1074
|
-
this.stackTrace.name,
|
|
1075
|
-
error.stack,
|
|
1076
|
-
|
|
1077
|
-
);
|
|
1096
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response7.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
1097
|
+
this.logger.error({
|
|
1098
|
+
message: import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1099
|
+
title: "EvalError",
|
|
1100
|
+
errorType: this.stackTrace.name,
|
|
1101
|
+
stackTrace: error.stack,
|
|
1102
|
+
httpCodeValue: import_opticore_http_response7.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1103
|
+
});
|
|
1078
1104
|
}
|
|
1079
1105
|
rangeError(error) {
|
|
1080
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
1081
|
-
this.logger.error(
|
|
1082
|
-
import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1083
|
-
"RangeError",
|
|
1084
|
-
this.stackTrace.name,
|
|
1085
|
-
error.stack,
|
|
1086
|
-
|
|
1087
|
-
);
|
|
1106
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response7.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
1107
|
+
this.logger.error({
|
|
1108
|
+
message: import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1109
|
+
title: "RangeError",
|
|
1110
|
+
errorType: this.stackTrace.name,
|
|
1111
|
+
stackTrace: error.stack,
|
|
1112
|
+
httpCodeValue: import_opticore_http_response7.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1113
|
+
});
|
|
1088
1114
|
}
|
|
1089
1115
|
referenceError(error) {
|
|
1090
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
1091
|
-
this.logger.error(
|
|
1092
|
-
import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1093
|
-
"ReferenceError",
|
|
1094
|
-
this.stackTrace.name,
|
|
1095
|
-
error.stack,
|
|
1096
|
-
|
|
1097
|
-
);
|
|
1116
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response7.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
1117
|
+
this.logger.error({
|
|
1118
|
+
message: import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1119
|
+
title: "ReferenceError",
|
|
1120
|
+
errorType: this.stackTrace.name,
|
|
1121
|
+
stackTrace: error.stack,
|
|
1122
|
+
httpCodeValue: import_opticore_http_response7.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1123
|
+
});
|
|
1098
1124
|
}
|
|
1099
1125
|
syntaxError(error) {
|
|
1100
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
1101
|
-
this.logger.error(
|
|
1102
|
-
import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1103
|
-
"SyntaxError",
|
|
1104
|
-
this.stackTrace.name,
|
|
1105
|
-
error.stack,
|
|
1106
|
-
|
|
1107
|
-
);
|
|
1126
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response7.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
1127
|
+
this.logger.error({
|
|
1128
|
+
message: import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1129
|
+
title: "SyntaxError",
|
|
1130
|
+
errorType: this.stackTrace.name,
|
|
1131
|
+
stackTrace: error.stack,
|
|
1132
|
+
httpCodeValue: import_opticore_http_response7.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1133
|
+
});
|
|
1108
1134
|
}
|
|
1109
1135
|
typeError(error) {
|
|
1110
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
1111
|
-
this.logger.error(
|
|
1112
|
-
import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1113
|
-
"TypeError",
|
|
1114
|
-
this.stackTrace.name,
|
|
1115
|
-
error.stack,
|
|
1116
|
-
|
|
1117
|
-
);
|
|
1136
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response7.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
1137
|
+
this.logger.error({
|
|
1138
|
+
message: import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1139
|
+
title: "TypeError",
|
|
1140
|
+
errorType: this.stackTrace.name,
|
|
1141
|
+
stackTrace: error.stack,
|
|
1142
|
+
httpCodeValue: import_opticore_http_response7.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1143
|
+
});
|
|
1118
1144
|
}
|
|
1119
1145
|
uRIError(error) {
|
|
1120
|
-
this.stackTrace = this.traceError(error.message, error.name,
|
|
1121
|
-
this.logger.error(
|
|
1122
|
-
import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1123
|
-
"URIError",
|
|
1124
|
-
this.stackTrace.name,
|
|
1125
|
-
error.stack,
|
|
1126
|
-
|
|
1127
|
-
);
|
|
1146
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response7.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
1147
|
+
this.logger.error({
|
|
1148
|
+
message: import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1149
|
+
title: "URIError",
|
|
1150
|
+
errorType: this.stackTrace.name,
|
|
1151
|
+
stackTrace: error.stack,
|
|
1152
|
+
httpCodeValue: import_opticore_http_response7.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1153
|
+
});
|
|
1128
1154
|
}
|
|
1129
1155
|
traceError(props, name, status7) {
|
|
1130
1156
|
return new StackTraceError(props, name, status7, true);
|