opticore-catch-exception-error 1.0.16 → 1.0.18
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 +9 -7
- package/dist/index.d.cts +19 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.js +8 -7
- package/dist/utils/translations/message.translation.fr.json +54 -54
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -38,6 +38,7 @@ __export(index_exports, {
|
|
|
38
38
|
JavaScriptErrors: () => JavaScriptErrors,
|
|
39
39
|
OpenSSLErrors: () => OpenSSLErrors,
|
|
40
40
|
ServerListenEventError: () => ServerListenEventError,
|
|
41
|
+
StackTraceError: () => StackTraceError,
|
|
41
42
|
SystemErrors: () => SystemErrors
|
|
42
43
|
});
|
|
43
44
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -503,7 +504,7 @@ var ServerListenEventError = class {
|
|
|
503
504
|
this.stackTrace.message,
|
|
504
505
|
"UncaughtException",
|
|
505
506
|
this.stackTrace.name,
|
|
506
|
-
|
|
507
|
+
error.stack,
|
|
507
508
|
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
508
509
|
);
|
|
509
510
|
}
|
|
@@ -666,7 +667,7 @@ var ServerListenEventError = class {
|
|
|
666
667
|
this.stackTrace.message,
|
|
667
668
|
import_opticore_translator2.TranslationLoader.t("expressErrorHandlingMiddleware", this.localeLanguage, { err }),
|
|
668
669
|
this.stackTrace.name,
|
|
669
|
-
|
|
670
|
+
err.stack,
|
|
670
671
|
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
671
672
|
);
|
|
672
673
|
} else {
|
|
@@ -695,7 +696,7 @@ var JavaScriptErrors = class {
|
|
|
695
696
|
import_opticore_translator3.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
696
697
|
"Error",
|
|
697
698
|
this.stackTrace.name,
|
|
698
|
-
|
|
699
|
+
error.stack,
|
|
699
700
|
import_opticore_http_response2.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
700
701
|
);
|
|
701
702
|
}
|
|
@@ -781,7 +782,7 @@ var SystemErrors = class {
|
|
|
781
782
|
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
782
783
|
"EACCES",
|
|
783
784
|
this.stackTrace.name,
|
|
784
|
-
|
|
785
|
+
error.stack,
|
|
785
786
|
import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
786
787
|
);
|
|
787
788
|
}
|
|
@@ -927,7 +928,7 @@ var OpenSSLErrors = class {
|
|
|
927
928
|
import_opticore_translator5.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
928
929
|
"ERR_OSSL_EVP_UNSUPPORTED",
|
|
929
930
|
this.stackTrace.name,
|
|
930
|
-
|
|
931
|
+
error.stack,
|
|
931
932
|
import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
932
933
|
);
|
|
933
934
|
}
|
|
@@ -973,7 +974,7 @@ var InternalErrors = class {
|
|
|
973
974
|
import_opticore_translator6.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
974
975
|
"ERR_INVALID_ARG_TYPE",
|
|
975
976
|
this.stackTrace.name,
|
|
976
|
-
|
|
977
|
+
error.stack,
|
|
977
978
|
import_opticore_http_response5.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
978
979
|
);
|
|
979
980
|
}
|
|
@@ -1049,7 +1050,7 @@ var AssertionErrors = class {
|
|
|
1049
1050
|
import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1050
1051
|
"Error",
|
|
1051
1052
|
this.stackTrace.name,
|
|
1052
|
-
|
|
1053
|
+
error.stack,
|
|
1053
1054
|
import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1054
1055
|
);
|
|
1055
1056
|
}
|
|
@@ -1127,5 +1128,6 @@ var AssertionErrors = class {
|
|
|
1127
1128
|
JavaScriptErrors,
|
|
1128
1129
|
OpenSSLErrors,
|
|
1129
1130
|
ServerListenEventError,
|
|
1131
|
+
StackTraceError,
|
|
1130
1132
|
SystemErrors
|
|
1131
1133
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import EventEmitter from 'node:events';
|
|
2
2
|
import { Request, Response, NextFunction } from 'opticore-express';
|
|
3
|
+
import { HttpStatusCode } from 'opticore-http-response';
|
|
3
4
|
|
|
4
5
|
declare const CErrorName: {
|
|
5
6
|
assertionError: string;
|
|
@@ -252,4 +253,21 @@ declare class AssertionErrors {
|
|
|
252
253
|
private traceError;
|
|
253
254
|
}
|
|
254
255
|
|
|
255
|
-
|
|
256
|
+
/**
|
|
257
|
+
* Handling and catch a Node.js error.
|
|
258
|
+
*/
|
|
259
|
+
declare class StackTraceError extends Error {
|
|
260
|
+
readonly name: string;
|
|
261
|
+
readonly httpCode: HttpStatusCode | any;
|
|
262
|
+
readonly isOperational: boolean;
|
|
263
|
+
/**
|
|
264
|
+
*
|
|
265
|
+
* @param props
|
|
266
|
+
* @param name
|
|
267
|
+
* @param httpCode
|
|
268
|
+
* @param isOperational
|
|
269
|
+
*/
|
|
270
|
+
constructor(props: string | undefined, name: string, httpCode: HttpStatusCode | any, isOperational: boolean);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export { AssertionErrors, CErrorName, CEvent, CEventNameError, InternalErrors, JavaScriptErrors, OpenSSLErrors, ServerListenEventError, StackTraceError, SystemErrors };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import EventEmitter from 'node:events';
|
|
2
2
|
import { Request, Response, NextFunction } from 'opticore-express';
|
|
3
|
+
import { HttpStatusCode } from 'opticore-http-response';
|
|
3
4
|
|
|
4
5
|
declare const CErrorName: {
|
|
5
6
|
assertionError: string;
|
|
@@ -252,4 +253,21 @@ declare class AssertionErrors {
|
|
|
252
253
|
private traceError;
|
|
253
254
|
}
|
|
254
255
|
|
|
255
|
-
|
|
256
|
+
/**
|
|
257
|
+
* Handling and catch a Node.js error.
|
|
258
|
+
*/
|
|
259
|
+
declare class StackTraceError extends Error {
|
|
260
|
+
readonly name: string;
|
|
261
|
+
readonly httpCode: HttpStatusCode | any;
|
|
262
|
+
readonly isOperational: boolean;
|
|
263
|
+
/**
|
|
264
|
+
*
|
|
265
|
+
* @param props
|
|
266
|
+
* @param name
|
|
267
|
+
* @param httpCode
|
|
268
|
+
* @param isOperational
|
|
269
|
+
*/
|
|
270
|
+
constructor(props: string | undefined, name: string, httpCode: HttpStatusCode | any, isOperational: boolean);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export { AssertionErrors, CErrorName, CEvent, CEventNameError, InternalErrors, JavaScriptErrors, OpenSSLErrors, ServerListenEventError, StackTraceError, SystemErrors };
|
package/dist/index.js
CHANGED
|
@@ -455,7 +455,7 @@ var ServerListenEventError = class {
|
|
|
455
455
|
this.stackTrace.message,
|
|
456
456
|
"UncaughtException",
|
|
457
457
|
this.stackTrace.name,
|
|
458
|
-
|
|
458
|
+
error.stack,
|
|
459
459
|
status.SERVICE_UNAVAILABLE
|
|
460
460
|
);
|
|
461
461
|
}
|
|
@@ -618,7 +618,7 @@ var ServerListenEventError = class {
|
|
|
618
618
|
this.stackTrace.message,
|
|
619
619
|
TranslationLoader2.t("expressErrorHandlingMiddleware", this.localeLanguage, { err }),
|
|
620
620
|
this.stackTrace.name,
|
|
621
|
-
|
|
621
|
+
err.stack,
|
|
622
622
|
status.SERVICE_UNAVAILABLE
|
|
623
623
|
);
|
|
624
624
|
} else {
|
|
@@ -647,7 +647,7 @@ var JavaScriptErrors = class {
|
|
|
647
647
|
TranslationLoader3.t(this.stackTrace.message, this.localLanguage),
|
|
648
648
|
"Error",
|
|
649
649
|
this.stackTrace.name,
|
|
650
|
-
|
|
650
|
+
error.stack,
|
|
651
651
|
status2.INTERNAL_SERVER_ERROR
|
|
652
652
|
);
|
|
653
653
|
}
|
|
@@ -733,7 +733,7 @@ var SystemErrors = class {
|
|
|
733
733
|
TranslationLoader4.t(this.stackTrace.message, this.localLanguage),
|
|
734
734
|
"EACCES",
|
|
735
735
|
this.stackTrace.name,
|
|
736
|
-
|
|
736
|
+
error.stack,
|
|
737
737
|
status3.INTERNAL_SERVER_ERROR
|
|
738
738
|
);
|
|
739
739
|
}
|
|
@@ -879,7 +879,7 @@ var OpenSSLErrors = class {
|
|
|
879
879
|
TranslationLoader5.t(this.stackTrace.message, this.localLanguage),
|
|
880
880
|
"ERR_OSSL_EVP_UNSUPPORTED",
|
|
881
881
|
this.stackTrace.name,
|
|
882
|
-
|
|
882
|
+
error.stack,
|
|
883
883
|
status4.INTERNAL_SERVER_ERROR
|
|
884
884
|
);
|
|
885
885
|
}
|
|
@@ -925,7 +925,7 @@ var InternalErrors = class {
|
|
|
925
925
|
TranslationLoader6.t(this.stackTrace.message, this.localLanguage),
|
|
926
926
|
"ERR_INVALID_ARG_TYPE",
|
|
927
927
|
this.stackTrace.name,
|
|
928
|
-
|
|
928
|
+
error.stack,
|
|
929
929
|
status5.INTERNAL_SERVER_ERROR
|
|
930
930
|
);
|
|
931
931
|
}
|
|
@@ -1001,7 +1001,7 @@ var AssertionErrors = class {
|
|
|
1001
1001
|
TranslationLoader7.t(this.stackTrace.message, this.localLanguage),
|
|
1002
1002
|
"Error",
|
|
1003
1003
|
this.stackTrace.name,
|
|
1004
|
-
|
|
1004
|
+
error.stack,
|
|
1005
1005
|
status6.INTERNAL_SERVER_ERROR
|
|
1006
1006
|
);
|
|
1007
1007
|
}
|
|
@@ -1078,5 +1078,6 @@ export {
|
|
|
1078
1078
|
JavaScriptErrors,
|
|
1079
1079
|
OpenSSLErrors,
|
|
1080
1080
|
ServerListenEventError,
|
|
1081
|
+
StackTraceError,
|
|
1081
1082
|
SystemErrors
|
|
1082
1083
|
};
|
|
@@ -1,58 +1,58 @@
|
|
|
1
1
|
{
|
|
2
|
-
"errorHostUrl": "
|
|
3
|
-
"listening": "
|
|
4
|
-
"webServer": "Web
|
|
5
|
-
"webHost": "
|
|
6
|
-
"badHost": "
|
|
7
|
-
"hostNotFound": "
|
|
8
|
-
"badPort": "
|
|
9
|
-
"errorPort": "
|
|
10
|
-
"errorHost": "
|
|
11
|
-
"serverStart": "
|
|
12
|
-
"serverStartError": "
|
|
13
|
-
"processExitCode": "
|
|
2
|
+
"errorHostUrl": "L'hôte et le port ne sont pas définis, veuillez les définir dans .env",
|
|
3
|
+
"listening": "écoute",
|
|
4
|
+
"webServer": "Serveur Web",
|
|
5
|
+
"webHost": "hôte",
|
|
6
|
+
"badHost": "mauvais hôte",
|
|
7
|
+
"hostNotFound": "introuvable",
|
|
8
|
+
"badPort": "mauvais port",
|
|
9
|
+
"errorPort": "Le port n'est pas correcte. Veuillez définir un port correct avec le numéro de port.",
|
|
10
|
+
"errorHost": "L'hôte ne peut être vide. Veuillez définir une chaîne d'hôte dans .env.",
|
|
11
|
+
"serverStart": "Démarrage du serveur",
|
|
12
|
+
"serverStartError": "Erreur de démarrage du serveur",
|
|
13
|
+
"processExitCode": "Le processus se terminera avec le code : {code}",
|
|
14
14
|
"beforeExit": "BeforeExit",
|
|
15
|
-
"childProcessDiscon": "
|
|
16
|
-
"processDiscon": "
|
|
17
|
-
"completed": "
|
|
18
|
-
"finishingProcessWell": "
|
|
19
|
-
"serverStopped": "[OK]
|
|
20
|
-
"somethingWentWrong": "
|
|
21
|
-
"genErrors": "
|
|
22
|
-
"exited": "
|
|
23
|
-
"incorrectCmd": "
|
|
24
|
-
"misuseShell": "
|
|
25
|
-
"cmdNotExecutable": "
|
|
26
|
-
"cmdNotFound": "
|
|
27
|
-
"cmdNotFoundInSystemPath": "
|
|
28
|
-
"argInvalid": "
|
|
29
|
-
"scriptEndedManuallyByCtrlC": "
|
|
30
|
-
"scriptEnded": "Script
|
|
31
|
-
"processEndedBySIGKILL": "
|
|
32
|
-
"accessProcessIllegally": "
|
|
33
|
-
"defaultSegment": "
|
|
34
|
-
"processReceivedSigtermSignal": "
|
|
35
|
-
"processReceived": "
|
|
36
|
-
"exitCode": "
|
|
37
|
-
"outRange": "
|
|
38
|
-
"errorOccurring": "
|
|
39
|
-
"errors": "
|
|
40
|
-
"warning": "
|
|
41
|
-
"promiseRejectionHandled": "
|
|
42
|
-
"rejectionPromise": "
|
|
43
|
-
"uncaughtExceptionHandled": "
|
|
44
|
-
"unhandledRejectionAtPromise": "
|
|
45
|
-
"unhandledRejection": "
|
|
46
|
-
"processGotMsg": "
|
|
47
|
-
"msgException": "message exception",
|
|
15
|
+
"childProcessDiscon": "Processus enfant déconnecté",
|
|
16
|
+
"processDiscon": "processus déconnecté",
|
|
17
|
+
"completed": "complété",
|
|
18
|
+
"finishingProcessWell": "Le processus se termine bien avec le code {code}",
|
|
19
|
+
"serverStopped": "[OK] Le serveur s'arrête",
|
|
20
|
+
"somethingWentWrong": "Quelque chose s'est mal passé",
|
|
21
|
+
"genErrors": "Erreur Generale",
|
|
22
|
+
"exited": "Sortie",
|
|
23
|
+
"incorrectCmd": "Utilisation incorrecte des commandes shell",
|
|
24
|
+
"misuseShell": "Mauvaise utilisation des fonctions intégrées du shell",
|
|
25
|
+
"cmdNotExecutable": "La commande est trouvée mais n'est pas exécutable (par exemple, tentative d'exécution d'un répertoire)",
|
|
26
|
+
"cmdNotFound": "Commande non trouvée",
|
|
27
|
+
"cmdNotFoundInSystemPath": "La commande n'a pas été trouvée dans le PATH du système ou est mal orthographiée",
|
|
28
|
+
"argInvalid": "Argument invalide",
|
|
29
|
+
"scriptEndedManuallyByCtrlC": "Indique que le script a été arrêté manuellement par l'utilisateur à l'aide du signal Control-C (SIGINT)",
|
|
30
|
+
"scriptEnded": "Script interrompu",
|
|
31
|
+
"processEndedBySIGKILL": "Indique que le processus a été interrompu par un signal SIGKILL, probablement en raison d'une situation de manque de mémoire",
|
|
32
|
+
"accessProcessIllegally": "Indique que le processus a accédé à une adresse mémoire illégale (segfault)",
|
|
33
|
+
"defaultSegment": "Erreur de segmentation",
|
|
34
|
+
"processReceivedSigtermSignal": "Indique que le processus a reçu un signal SIGTERM pour s'interrompre",
|
|
35
|
+
"processReceived": "le processus a reçu un SIGTERM",
|
|
36
|
+
"exitCode": "Code de sortie en dehors de la plage autorisée (0-255 pour les systèmes de type Unix)",
|
|
37
|
+
"outRange": "hors de portée",
|
|
38
|
+
"errorOccurring": "Une erreur se produit",
|
|
39
|
+
"errors": "erreurs",
|
|
40
|
+
"warning": "Avertissement",
|
|
41
|
+
"promiseRejectionHandled": "Le rejet de la promesse est traité à : {promise}",
|
|
42
|
+
"rejectionPromise": "promesse de rejet",
|
|
43
|
+
"uncaughtExceptionHandled": "exception non interceptée gérée",
|
|
44
|
+
"unhandledRejectionAtPromise": "Rejet non géré à : Promesse {promise} -- raison {reason}",
|
|
45
|
+
"unhandledRejection": "Rejet non traité",
|
|
46
|
+
"processGotMsg": "le processus a reçu le message {message}",
|
|
47
|
+
"msgException": "message d'exception",
|
|
48
48
|
"promiseReason": "{promise} -- {reason}",
|
|
49
|
-
"multipleResolvesDetected": "
|
|
50
|
-
"okSuccess": "[ OK ]
|
|
51
|
-
"processPIDReceivedSignal": "
|
|
52
|
-
"allProcessStopped": "
|
|
53
|
-
"internalServerError": "
|
|
54
|
-
"resStatusNotFunc": "res.status
|
|
55
|
-
"respndNotFunc": "
|
|
56
|
-
"expressErrorHandlingMiddleware": "
|
|
57
|
-
"expressError": "
|
|
49
|
+
"multipleResolvesDetected": "Résolutions multiples détectées : {type}",
|
|
50
|
+
"okSuccess": "[ OK ] Succès",
|
|
51
|
+
"processPIDReceivedSignal": "Le processus {process.pid} a reçu un signal SIGTERM",
|
|
52
|
+
"allProcessStopped": "Tous les processus sont interrompus",
|
|
53
|
+
"internalServerError": "Erreur interne du serveur : {err}",
|
|
54
|
+
"resStatusNotFunc": "res.status n'est pas une fonction {err}",
|
|
55
|
+
"respndNotFunc": "réponse non Fonction {err}",
|
|
56
|
+
"expressErrorHandlingMiddleware": "Middleware express de gestion des erreurs {err}",
|
|
57
|
+
"expressError": "Erreur express {err}"
|
|
58
58
|
}
|