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