opticore-catch-exception-error 1.0.18 → 1.0.20
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 +166 -53
- package/dist/index.d.cts +105 -1
- package/dist/index.d.ts +105 -1
- package/dist/index.js +165 -53
- package/dist/utils/translations/message.translation.en.json +1 -1
- package/dist/utils/translations/message.translation.fr.json +1 -1
- package/package.json +1 -1
- package/example/index.ts +0 -20
package/dist/index.cjs
CHANGED
|
@@ -31,6 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
AssertionErrors: () => AssertionErrors,
|
|
34
|
+
CCodeError: () => CCodeError,
|
|
34
35
|
CErrorName: () => CErrorName,
|
|
35
36
|
CEvent: () => CEvent,
|
|
36
37
|
CEventNameError: () => CEventNameError,
|
|
@@ -85,7 +86,8 @@ var CErrorName = {
|
|
|
85
86
|
typeError: "TypeError",
|
|
86
87
|
uriError: "URIError",
|
|
87
88
|
uncaughtException: "uncaughtException",
|
|
88
|
-
unhandledRejection: "unhandledRejection"
|
|
89
|
+
unhandledRejection: "unhandledRejection",
|
|
90
|
+
transformError: "TransformError"
|
|
89
91
|
};
|
|
90
92
|
|
|
91
93
|
// src/domains/constants/event.constant.ts
|
|
@@ -218,7 +220,7 @@ var ServerListenEventError = class {
|
|
|
218
220
|
this.logger.error(
|
|
219
221
|
this.stackTrace.message,
|
|
220
222
|
import_opticore_translator2.TranslationLoader.t("webServer", this.localeLanguage),
|
|
221
|
-
import_opticore_translator2.TranslationLoader.t("
|
|
223
|
+
import_opticore_translator2.TranslationLoader.t("badPort", this.localeLanguage),
|
|
222
224
|
this.stackTrace.stack,
|
|
223
225
|
import_opticore_http_response.HttpStatusCode.BAD_REQUEST
|
|
224
226
|
);
|
|
@@ -471,21 +473,18 @@ var ServerListenEventError = class {
|
|
|
471
473
|
* @param promise
|
|
472
474
|
*/
|
|
473
475
|
promiseRejectionHandled(promise) {
|
|
474
|
-
|
|
475
|
-
this.
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
this.
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
);
|
|
487
|
-
} catch (err) {
|
|
488
|
-
}
|
|
476
|
+
this.stackTrace = this.traceError(
|
|
477
|
+
import_opticore_translator2.TranslationLoader.t("promise", this.localeLanguage, { promise }),
|
|
478
|
+
import_opticore_translator2.TranslationLoader.t("rejectionPromise", this.localeLanguage, { promise }),
|
|
479
|
+
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
480
|
+
);
|
|
481
|
+
this.logger.error(
|
|
482
|
+
this.stackTrace.message,
|
|
483
|
+
"PromiseRejectionHandled",
|
|
484
|
+
this.stackTrace.name,
|
|
485
|
+
promise,
|
|
486
|
+
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
487
|
+
);
|
|
489
488
|
}
|
|
490
489
|
/**
|
|
491
490
|
*
|
|
@@ -533,7 +532,7 @@ var ServerListenEventError = class {
|
|
|
533
532
|
this.stackTrace.message,
|
|
534
533
|
"UnhandledRejection",
|
|
535
534
|
this.stackTrace.name,
|
|
536
|
-
|
|
535
|
+
`reason: ${reason} - promise: ${promise}`,
|
|
537
536
|
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
538
537
|
);
|
|
539
538
|
}
|
|
@@ -551,7 +550,7 @@ var ServerListenEventError = class {
|
|
|
551
550
|
this.stackTrace.message,
|
|
552
551
|
import_opticore_translator2.TranslationLoader.t("warning", this.localeLanguage, { warning }),
|
|
553
552
|
this.stackTrace.name,
|
|
554
|
-
|
|
553
|
+
`warning: ${warning}`,
|
|
555
554
|
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
556
555
|
);
|
|
557
556
|
}
|
|
@@ -569,7 +568,7 @@ var ServerListenEventError = class {
|
|
|
569
568
|
this.stackTrace.message,
|
|
570
569
|
"Message",
|
|
571
570
|
this.stackTrace.name,
|
|
572
|
-
|
|
571
|
+
`message: ${message}`,
|
|
573
572
|
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
574
573
|
);
|
|
575
574
|
}
|
|
@@ -589,7 +588,7 @@ var ServerListenEventError = class {
|
|
|
589
588
|
this.stackTrace.message,
|
|
590
589
|
"multipleResolves",
|
|
591
590
|
this.stackTrace.name,
|
|
592
|
-
|
|
591
|
+
`type: ${type}, promise: ${promise}, reason: ${reason}`,
|
|
593
592
|
import_opticore_http_response.HttpStatusCode.SERVICE_UNAVAILABLE
|
|
594
593
|
);
|
|
595
594
|
}
|
|
@@ -617,7 +616,7 @@ var ServerListenEventError = class {
|
|
|
617
616
|
this.stackTrace.message,
|
|
618
617
|
"SIGTERM",
|
|
619
618
|
this.stackTrace.name,
|
|
620
|
-
|
|
619
|
+
signal.toString(),
|
|
621
620
|
import_opticore_http_response.HttpStatusCode.NOT_ACCEPTABLE
|
|
622
621
|
);
|
|
623
622
|
import_process.default.exit(0);
|
|
@@ -706,7 +705,7 @@ var JavaScriptErrors = class {
|
|
|
706
705
|
import_opticore_translator3.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
707
706
|
"EvalError",
|
|
708
707
|
this.stackTrace.name,
|
|
709
|
-
|
|
708
|
+
error.stack,
|
|
710
709
|
import_opticore_http_response2.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
711
710
|
);
|
|
712
711
|
}
|
|
@@ -716,7 +715,7 @@ var JavaScriptErrors = class {
|
|
|
716
715
|
import_opticore_translator3.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
717
716
|
"RangeError",
|
|
718
717
|
this.stackTrace.name,
|
|
719
|
-
|
|
718
|
+
error.stack,
|
|
720
719
|
import_opticore_http_response2.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
721
720
|
);
|
|
722
721
|
}
|
|
@@ -726,7 +725,7 @@ var JavaScriptErrors = class {
|
|
|
726
725
|
import_opticore_translator3.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
727
726
|
"ReferenceError",
|
|
728
727
|
this.stackTrace.name,
|
|
729
|
-
|
|
728
|
+
error.stack,
|
|
730
729
|
import_opticore_http_response2.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
731
730
|
);
|
|
732
731
|
}
|
|
@@ -736,7 +735,7 @@ var JavaScriptErrors = class {
|
|
|
736
735
|
import_opticore_translator3.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
737
736
|
"SyntaxError",
|
|
738
737
|
this.stackTrace.name,
|
|
739
|
-
|
|
738
|
+
error.stack,
|
|
740
739
|
import_opticore_http_response2.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
741
740
|
);
|
|
742
741
|
}
|
|
@@ -746,7 +745,7 @@ var JavaScriptErrors = class {
|
|
|
746
745
|
import_opticore_translator3.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
747
746
|
"TypeError",
|
|
748
747
|
this.stackTrace.name,
|
|
749
|
-
|
|
748
|
+
error.stack,
|
|
750
749
|
import_opticore_http_response2.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
751
750
|
);
|
|
752
751
|
}
|
|
@@ -756,7 +755,7 @@ var JavaScriptErrors = class {
|
|
|
756
755
|
import_opticore_translator3.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
757
756
|
"URIError",
|
|
758
757
|
this.stackTrace.name,
|
|
759
|
-
|
|
758
|
+
error.stack,
|
|
760
759
|
import_opticore_http_response2.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
761
760
|
);
|
|
762
761
|
}
|
|
@@ -792,7 +791,7 @@ var SystemErrors = class {
|
|
|
792
791
|
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
793
792
|
"EADDRINUSE",
|
|
794
793
|
this.stackTrace.name,
|
|
795
|
-
|
|
794
|
+
error.stack,
|
|
796
795
|
import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
797
796
|
);
|
|
798
797
|
}
|
|
@@ -802,7 +801,7 @@ var SystemErrors = class {
|
|
|
802
801
|
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
803
802
|
"ECONNREFUSED",
|
|
804
803
|
this.stackTrace.name,
|
|
805
|
-
|
|
804
|
+
error.stack,
|
|
806
805
|
import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
807
806
|
);
|
|
808
807
|
}
|
|
@@ -812,7 +811,7 @@ var SystemErrors = class {
|
|
|
812
811
|
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
813
812
|
"ECONNRESET",
|
|
814
813
|
this.stackTrace.name,
|
|
815
|
-
|
|
814
|
+
error.stack,
|
|
816
815
|
import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
817
816
|
);
|
|
818
817
|
}
|
|
@@ -822,7 +821,7 @@ var SystemErrors = class {
|
|
|
822
821
|
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
823
822
|
"EEXIST",
|
|
824
823
|
this.stackTrace.name,
|
|
825
|
-
|
|
824
|
+
error.stack,
|
|
826
825
|
import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
827
826
|
);
|
|
828
827
|
}
|
|
@@ -832,7 +831,7 @@ var SystemErrors = class {
|
|
|
832
831
|
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
833
832
|
"EISDIR",
|
|
834
833
|
this.stackTrace.name,
|
|
835
|
-
|
|
834
|
+
error.stack,
|
|
836
835
|
import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
837
836
|
);
|
|
838
837
|
}
|
|
@@ -842,7 +841,7 @@ var SystemErrors = class {
|
|
|
842
841
|
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
843
842
|
"EMFILE",
|
|
844
843
|
this.stackTrace.name,
|
|
845
|
-
|
|
844
|
+
error.stack,
|
|
846
845
|
import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
847
846
|
);
|
|
848
847
|
}
|
|
@@ -852,7 +851,7 @@ var SystemErrors = class {
|
|
|
852
851
|
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
853
852
|
"ENOENT",
|
|
854
853
|
this.stackTrace.name,
|
|
855
|
-
|
|
854
|
+
error.stack,
|
|
856
855
|
import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
857
856
|
);
|
|
858
857
|
}
|
|
@@ -862,7 +861,7 @@ var SystemErrors = class {
|
|
|
862
861
|
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
863
862
|
"ENOTDIR",
|
|
864
863
|
this.stackTrace.name,
|
|
865
|
-
|
|
864
|
+
error.stack,
|
|
866
865
|
import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
867
866
|
);
|
|
868
867
|
}
|
|
@@ -872,7 +871,7 @@ var SystemErrors = class {
|
|
|
872
871
|
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
873
872
|
"ENOTEMPTY",
|
|
874
873
|
this.stackTrace.name,
|
|
875
|
-
|
|
874
|
+
error.stack,
|
|
876
875
|
import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
877
876
|
);
|
|
878
877
|
}
|
|
@@ -882,7 +881,7 @@ var SystemErrors = class {
|
|
|
882
881
|
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
883
882
|
"EPERM",
|
|
884
883
|
this.stackTrace.name,
|
|
885
|
-
|
|
884
|
+
error.stack,
|
|
886
885
|
import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
887
886
|
);
|
|
888
887
|
}
|
|
@@ -892,7 +891,7 @@ var SystemErrors = class {
|
|
|
892
891
|
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
893
892
|
"EPIPE",
|
|
894
893
|
this.stackTrace.name,
|
|
895
|
-
|
|
894
|
+
error.stack,
|
|
896
895
|
import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
897
896
|
);
|
|
898
897
|
}
|
|
@@ -902,7 +901,7 @@ var SystemErrors = class {
|
|
|
902
901
|
import_opticore_translator4.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
903
902
|
"ETIMEDOUT",
|
|
904
903
|
this.stackTrace.name,
|
|
905
|
-
|
|
904
|
+
error.stack,
|
|
906
905
|
import_opticore_http_response3.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
907
906
|
);
|
|
908
907
|
}
|
|
@@ -938,7 +937,7 @@ var OpenSSLErrors = class {
|
|
|
938
937
|
import_opticore_translator5.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
939
938
|
"ERR_OSSL_BAD_DECRYPT",
|
|
940
939
|
this.stackTrace.name,
|
|
941
|
-
|
|
940
|
+
error.stack,
|
|
942
941
|
import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
943
942
|
);
|
|
944
943
|
}
|
|
@@ -948,7 +947,7 @@ var OpenSSLErrors = class {
|
|
|
948
947
|
import_opticore_translator5.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
949
948
|
"ERR_OSSL_WRONG_FINAL_BLOCK_LENGTH",
|
|
950
949
|
this.stackTrace.name,
|
|
951
|
-
|
|
950
|
+
error.stack,
|
|
952
951
|
import_opticore_http_response4.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
953
952
|
);
|
|
954
953
|
}
|
|
@@ -984,7 +983,7 @@ var InternalErrors = class {
|
|
|
984
983
|
import_opticore_translator6.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
985
984
|
"ERR_INVALID_CALLBACK",
|
|
986
985
|
this.stackTrace.name,
|
|
987
|
-
|
|
986
|
+
error.stack,
|
|
988
987
|
import_opticore_http_response5.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
989
988
|
);
|
|
990
989
|
}
|
|
@@ -994,7 +993,7 @@ var InternalErrors = class {
|
|
|
994
993
|
import_opticore_translator6.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
995
994
|
"ERR_HTTP_HEADERS_SENT",
|
|
996
995
|
this.stackTrace.name,
|
|
997
|
-
|
|
996
|
+
error.stack,
|
|
998
997
|
import_opticore_http_response5.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
999
998
|
);
|
|
1000
999
|
}
|
|
@@ -1004,7 +1003,7 @@ var InternalErrors = class {
|
|
|
1004
1003
|
import_opticore_translator6.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1005
1004
|
"ERR_STREAM_DESTROYED",
|
|
1006
1005
|
this.stackTrace.name,
|
|
1007
|
-
|
|
1006
|
+
error.stack,
|
|
1008
1007
|
import_opticore_http_response5.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1009
1008
|
);
|
|
1010
1009
|
}
|
|
@@ -1014,7 +1013,7 @@ var InternalErrors = class {
|
|
|
1014
1013
|
import_opticore_translator6.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1015
1014
|
"ERR_TLS_CERT_ALTNAME_INVALID",
|
|
1016
1015
|
this.stackTrace.name,
|
|
1017
|
-
|
|
1016
|
+
error.stack,
|
|
1018
1017
|
import_opticore_http_response5.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1019
1018
|
);
|
|
1020
1019
|
}
|
|
@@ -1024,7 +1023,7 @@ var InternalErrors = class {
|
|
|
1024
1023
|
import_opticore_translator6.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1025
1024
|
"ERR_UNSUPPORTED_ESM_URL_SCHEME",
|
|
1026
1025
|
this.stackTrace.name,
|
|
1027
|
-
|
|
1026
|
+
error.stack,
|
|
1028
1027
|
import_opticore_http_response5.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1029
1028
|
);
|
|
1030
1029
|
}
|
|
@@ -1044,6 +1043,16 @@ var AssertionErrors = class {
|
|
|
1044
1043
|
constructor(defaultLocalLang) {
|
|
1045
1044
|
this.localLanguage = defaultLocalLang;
|
|
1046
1045
|
}
|
|
1046
|
+
assertionError(error) {
|
|
1047
|
+
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
1048
|
+
this.logger.error(
|
|
1049
|
+
import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1050
|
+
"AssertionError",
|
|
1051
|
+
this.stackTrace.name,
|
|
1052
|
+
error.stack,
|
|
1053
|
+
import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1054
|
+
);
|
|
1055
|
+
}
|
|
1047
1056
|
allError(error) {
|
|
1048
1057
|
this.stackTrace = this.traceError(error.message, error.name, import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR);
|
|
1049
1058
|
this.logger.error(
|
|
@@ -1060,7 +1069,7 @@ var AssertionErrors = class {
|
|
|
1060
1069
|
import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1061
1070
|
"EvalError",
|
|
1062
1071
|
this.stackTrace.name,
|
|
1063
|
-
|
|
1072
|
+
error.stack,
|
|
1064
1073
|
import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1065
1074
|
);
|
|
1066
1075
|
}
|
|
@@ -1070,7 +1079,7 @@ var AssertionErrors = class {
|
|
|
1070
1079
|
import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1071
1080
|
"RangeError",
|
|
1072
1081
|
this.stackTrace.name,
|
|
1073
|
-
|
|
1082
|
+
error.stack,
|
|
1074
1083
|
import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1075
1084
|
);
|
|
1076
1085
|
}
|
|
@@ -1080,7 +1089,7 @@ var AssertionErrors = class {
|
|
|
1080
1089
|
import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1081
1090
|
"ReferenceError",
|
|
1082
1091
|
this.stackTrace.name,
|
|
1083
|
-
|
|
1092
|
+
error.stack,
|
|
1084
1093
|
import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1085
1094
|
);
|
|
1086
1095
|
}
|
|
@@ -1090,7 +1099,7 @@ var AssertionErrors = class {
|
|
|
1090
1099
|
import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1091
1100
|
"SyntaxError",
|
|
1092
1101
|
this.stackTrace.name,
|
|
1093
|
-
|
|
1102
|
+
error.stack,
|
|
1094
1103
|
import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1095
1104
|
);
|
|
1096
1105
|
}
|
|
@@ -1100,7 +1109,7 @@ var AssertionErrors = class {
|
|
|
1100
1109
|
import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1101
1110
|
"TypeError",
|
|
1102
1111
|
this.stackTrace.name,
|
|
1103
|
-
|
|
1112
|
+
error.stack,
|
|
1104
1113
|
import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1105
1114
|
);
|
|
1106
1115
|
}
|
|
@@ -1110,7 +1119,7 @@ var AssertionErrors = class {
|
|
|
1110
1119
|
import_opticore_translator7.TranslationLoader.t(this.stackTrace.message, this.localLanguage),
|
|
1111
1120
|
"URIError",
|
|
1112
1121
|
this.stackTrace.name,
|
|
1113
|
-
|
|
1122
|
+
error.stack,
|
|
1114
1123
|
import_opticore_http_response6.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
1115
1124
|
);
|
|
1116
1125
|
}
|
|
@@ -1118,9 +1127,113 @@ var AssertionErrors = class {
|
|
|
1118
1127
|
return new StackTraceError(props, name, status7, true);
|
|
1119
1128
|
}
|
|
1120
1129
|
};
|
|
1130
|
+
|
|
1131
|
+
// src/domains/constants/codeError.constant.ts
|
|
1132
|
+
var CCodeError = {
|
|
1133
|
+
CERT_NOT_YET_VALID: "CERT_NOT_YET_VALID",
|
|
1134
|
+
CERT_HAS_EXPIRED: "CERT_HAS_EXPIRED",
|
|
1135
|
+
CRL_NOT_YET_VALID: "CRL_NOT_YET_VALID",
|
|
1136
|
+
CRL_HAS_EXPIRED: "CRL_HAS_EXPIRED",
|
|
1137
|
+
CERT_REVOKED: "CERT_REVOKED",
|
|
1138
|
+
UNABLE_TO_GET_ISSUER_CERT: "UNABLE_TO_GET_ISSUER_CERT",
|
|
1139
|
+
UNABLE_TO_GET_ISSUER_CERT_LOCALLY: "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
1140
|
+
DEPTH_ZERO_SELF_SIGNED_CERT: "DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
1141
|
+
SELF_SIGNED_CERT_IN_CHAIN: "SELF_SIGNED_CERT_IN_CHAIN",
|
|
1142
|
+
CERT_CHAIN_TOO_LONG: "CERT_CHAIN_TOO_LONG",
|
|
1143
|
+
UNABLE_TO_GET_CRL: "UNABLE_TO_GET_CRL",
|
|
1144
|
+
UNABLE_TO_VERIFY_LEAF_SIGNATURE: "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
1145
|
+
CERT_UNTRUSTED: "CERT_UNTRUSTED",
|
|
1146
|
+
INVALID_CA: "INVALID_CA",
|
|
1147
|
+
PATH_LENGTH_EXCEEDED: "PATH_LENGTH_EXCEEDED",
|
|
1148
|
+
HOSTNAME_MISMATCH: "HOSTNAME_MISMATCH",
|
|
1149
|
+
INVALID_PURPOSE: "INVALID_PURPOSE",
|
|
1150
|
+
CERT_REJECTED: "CERT_REJECTED",
|
|
1151
|
+
CERT_SIGNATURE_FAILURE: "CERT_SIGNATURE_FAILURE",
|
|
1152
|
+
CRL_SIGNATURE_FAILURE: "CRL_SIGNATURE_FAILURE",
|
|
1153
|
+
ERROR_IN_CERT_NOT_BEFORE_FIELD: "ERROR_IN_CERT_NOT_BEFORE_FIELD",
|
|
1154
|
+
ERROR_IN_CERT_NOT_AFTER_FIELD: "ERROR_IN_CERT_NOT_AFTER_FIELD",
|
|
1155
|
+
ERROR_IN_CRL_LAST_UPDATE_FIELD: "ERROR_IN_CRL_LAST_UPDATE_FIELD",
|
|
1156
|
+
ERROR_IN_CRL_NEXT_UPDATE_FIELD: "ERROR_IN_CRL_NEXT_UPDATE_FIELD",
|
|
1157
|
+
UNABLE_TO_DECRYPT_CERT_SIGNATURE: "UNABLE_TO_DECRYPT_CERT_SIGNATURE",
|
|
1158
|
+
UNABLE_TO_DECRYPT_CRL_SIGNATURE: "UNABLE_TO_DECRYPT_CRL_SIGNATURE",
|
|
1159
|
+
UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY: "UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY",
|
|
1160
|
+
OUT_OF_MEM: "OUT_OF_MEM",
|
|
1161
|
+
ABORT_ERR: "ABORT_ERR",
|
|
1162
|
+
ERR_ACCESS_DENIED: "ERR_ACCESS_DENIED",
|
|
1163
|
+
ERR_AMBIGUOUS_ARGUMENT: "ERR_AMBIGUOUS_ARGUMENT",
|
|
1164
|
+
ERR_ARG_NOT_ITERABLE: "ERR_ARG_NOT_ITERABLE",
|
|
1165
|
+
ERR_ASSERTION: "ERR_ASSERTION",
|
|
1166
|
+
ERR_ASYNC_CALLBACK: "ERR_ASYNC_CALLBACK",
|
|
1167
|
+
ERR_ASYNC_TYPE: "ERR_ASYNC_TYPE",
|
|
1168
|
+
ERR_BROTLI_COMPRESSION_FAILED: "ERR_BROTLI_COMPRESSION_FAILED",
|
|
1169
|
+
ERR_BROTLI_INVALID_PARAM: "ERR_BROTLI_INVALID_PARAM",
|
|
1170
|
+
ERR_BUFFER_CONTEXT_NOT_AVAILABLE: "ERR_BUFFER_CONTEXT_NOT_AVAILABLE",
|
|
1171
|
+
ERR_BUFFER_OUT_OF_BOUNDS: "ERR_BUFFER_OUT_OF_BOUNDS",
|
|
1172
|
+
ERR_BUFFER_TOO_LARGE: "ERR_BUFFER_TOO_LARGE",
|
|
1173
|
+
ERR_CANNOT_WATCH_SIGINT: "ERR_CANNOT_WATCH_SIGINT",
|
|
1174
|
+
ERR_CHILD_CLOSED_BEFORE_REPLY: "ERR_CHILD_CLOSED_BEFORE_REPLY",
|
|
1175
|
+
ERR_CHILD_PROCESS_IPC_REQUIRED: "ERR_CHILD_PROCESS_IPC_REQUIRED",
|
|
1176
|
+
ERR_CHILD_PROCESS_STDIO_MAXBUFFER: "ERR_CHILD_PROCESS_STDIO_MAXBUFFER",
|
|
1177
|
+
ERR_CLOSED_MESSAGE_PORT: "ERR_CLOSED_MESSAGE_PORT",
|
|
1178
|
+
ERR_CONSOLE_WRITABLE_STREAM: "ERR_CONSOLE_WRITABLE_STREAM",
|
|
1179
|
+
ERR_CONSTRUCT_CALL_INVALID: "ERR_CONSTRUCT_CALL_INVALID",
|
|
1180
|
+
ERR_CONSTRUCT_CALL_REQUIRED: "ERR_CONSTRUCT_CALL_REQUIRED",
|
|
1181
|
+
ERR_CONTEXT_NOT_INITIALIZED: "ERR_CONTEXT_NOT_INITIALIZED",
|
|
1182
|
+
ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED: "ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED",
|
|
1183
|
+
ERR_CRYPTO_ECDH_INVALID_FORMAT: "ERR_CRYPTO_ECDH_INVALID_FORMAT",
|
|
1184
|
+
ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY: "ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY",
|
|
1185
|
+
ERR_CRYPTO_ENGINE_UNKNOWN: "ERR_CRYPTO_ENGINE_UNKNOWN",
|
|
1186
|
+
ERR_CRYPTO_FIPS_FORCED: "ERR_CRYPTO_FIPS_FORCED",
|
|
1187
|
+
ERR_CRYPTO_FIPS_UNAVAILABLE: "ERR_CRYPTO_FIPS_UNAVAILABLE",
|
|
1188
|
+
ERR_CRYPTO_HASH_FINALIZED: "ERR_CRYPTO_HASH_FINALIZED",
|
|
1189
|
+
ERR_CRYPTO_HASH_UPDATE_FAILED: "ERR_CRYPTO_HASH_UPDATE_FAILED",
|
|
1190
|
+
ERR_CRYPTO_INCOMPATIBLE_KEY: "ERR_CRYPTO_INCOMPATIBLE_KEY",
|
|
1191
|
+
ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS: "ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS",
|
|
1192
|
+
ERR_CRYPTO_INITIALIZATION_FAILED: "ERR_CRYPTO_INITIALIZATION_FAILED",
|
|
1193
|
+
ERR_CRYPTO_INVALID_AUTH_TAG: "ERR_CRYPTO_INVALID_AUTH_TAG",
|
|
1194
|
+
ERR_CRYPTO_INVALID_COUNTER: "ERR_CRYPTO_INVALID_COUNTER",
|
|
1195
|
+
ERR_CRYPTO_INVALID_CURVE: "ERR_CRYPTO_INVALID_CURVE",
|
|
1196
|
+
ERR_CRYPTO_INVALID_DIGEST: "ERR_CRYPTO_INVALID_DIGEST",
|
|
1197
|
+
ERR_CRYPTO_INVALID_IV: "ERR_CRYPTO_INVALID_IV",
|
|
1198
|
+
ERR_CRYPTO_INVALID_JWK: "ERR_CRYPTO_INVALID_JWK",
|
|
1199
|
+
ERR_CRYPTO_INVALID_KEYLEN: "ERR_CRYPTO_INVALID_KEYLEN",
|
|
1200
|
+
ERR_CRYPTO_INVALID_KEYPAIR: "ERR_CRYPTO_INVALID_KEYPAIR",
|
|
1201
|
+
ERR_CRYPTO_INVALID_KEYTYPE: "ERR_CRYPTO_INVALID_KEYTYPE",
|
|
1202
|
+
ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: "ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE",
|
|
1203
|
+
ERR_CRYPTO_INVALID_MESSAGELEN: "ERR_CRYPTO_INVALID_MESSAGELEN",
|
|
1204
|
+
ERR_CRYPTO_INVALID_SCRYPT_PARAMS: "ERR_CRYPTO_INVALID_SCRYPT_PARAMS",
|
|
1205
|
+
ERR_CRYPTO_INVALID_STATE: "ERR_CRYPTO_INVALID_STATE",
|
|
1206
|
+
ERR_CRYPTO_INVALID_TAG_LENGTH: "ERR_CRYPTO_INVALID_TAG_LENGTH",
|
|
1207
|
+
ERR_CRYPTO_JOB_INIT_FAILED: "ERR_CRYPTO_JOB_INIT_FAILED",
|
|
1208
|
+
ERR_CRYPTO_JWK_UNSUPPORTED_CURVE: "ERR_CRYPTO_JWK_UNSUPPORTED_CURVE",
|
|
1209
|
+
ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE: "ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE",
|
|
1210
|
+
ERR_CRYPTO_OPERATION_FAILED: "ERR_CRYPTO_OPERATION_FAILED",
|
|
1211
|
+
ERR_CRYPTO_PBKDF2_ERROR: "ERR_CRYPTO_PBKDF2_ERROR",
|
|
1212
|
+
ERR_CRYPTO_SCRYPT_NOT_SUPPORTED: "ERR_CRYPTO_SCRYPT_NOT_SUPPORTED",
|
|
1213
|
+
ERR_CRYPTO_SIGN_KEY_REQUIRED: "ERR_CRYPTO_SIGN_KEY_REQUIRED",
|
|
1214
|
+
ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH: "ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH",
|
|
1215
|
+
ERR_CRYPTO_UNKNOWN_CIPHER: "ERR_CRYPTO_UNKNOWN_CIPHER",
|
|
1216
|
+
ERR_CRYPTO_UNKNOWN_DH_GROUP: "ERR_CRYPTO_UNKNOWN_DH_GROUP",
|
|
1217
|
+
ERR_CRYPTO_UNSUPPORTED_OPERATION: "ERR_CRYPTO_UNSUPPORTED_OPERATION",
|
|
1218
|
+
ERR_DEBUGGER_ERROR: "ERR_DEBUGGER_ERROR",
|
|
1219
|
+
ERR_DEBUGGER_STARTUP_ERROR: "ERR_DEBUGGER_STARTUP_ERROR",
|
|
1220
|
+
ERR_DIR_CLOSED: "ERR_DIR_CLOSED",
|
|
1221
|
+
ERR_DIR_CONCURRENT_OPERATION: "ERR_DIR_CONCURRENT_OPERATION",
|
|
1222
|
+
ERR_DLOPEN_DISABLED: "ERR_DLOPEN_DISABLED",
|
|
1223
|
+
ERR_DLOPEN_FAILED: "ERR_DLOPEN_FAILED",
|
|
1224
|
+
ERR_DNS_SET_SERVERS_FAILED: "ERR_DNS_SET_SERVERS_FAILED",
|
|
1225
|
+
ERR_DOMAIN_CALLBACK_NOT_AVAILABLE: "ERR_DOMAIN_CALLBACK_NOT_AVAILABLE",
|
|
1226
|
+
ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE: "ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE",
|
|
1227
|
+
ERR_DUPLICATE_STARTUP_SNAPSHOT_MAIN_FUNCTION: "ERR_DUPLICATE_STARTUP_SNAPSHOT_MAIN_FUNCTION",
|
|
1228
|
+
ERR_ENCODING_INVALID_ENCODED_DATA: "ERR_ENCODING_INVALID_ENCODED_DATA",
|
|
1229
|
+
ERR_ENCODING_NOT_SUPPORTED: "ERR_ENCODING_NOT_SUPPORTED",
|
|
1230
|
+
ERR_EVAL_ESM_CANNOT_PRINT: "ERR_EVAL_ESM_CANNOT_PRINT",
|
|
1231
|
+
ERR_EVENT_RECURSION: "ERR_EVENT_RECURSION"
|
|
1232
|
+
};
|
|
1121
1233
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1122
1234
|
0 && (module.exports = {
|
|
1123
1235
|
AssertionErrors,
|
|
1236
|
+
CCodeError,
|
|
1124
1237
|
CErrorName,
|
|
1125
1238
|
CEvent,
|
|
1126
1239
|
CEventNameError,
|
package/dist/index.d.cts
CHANGED
|
@@ -40,6 +40,7 @@ declare const CErrorName: {
|
|
|
40
40
|
uriError: string;
|
|
41
41
|
uncaughtException: string;
|
|
42
42
|
unhandledRejection: string;
|
|
43
|
+
transformError: string;
|
|
43
44
|
};
|
|
44
45
|
|
|
45
46
|
declare const CEvent: {
|
|
@@ -243,6 +244,7 @@ declare class AssertionErrors {
|
|
|
243
244
|
private stackTrace?;
|
|
244
245
|
private readonly localLanguage;
|
|
245
246
|
constructor(defaultLocalLang: string);
|
|
247
|
+
assertionError(error: any): void;
|
|
246
248
|
allError(error: any): void;
|
|
247
249
|
evalError(error: any): void;
|
|
248
250
|
rangeError(error: any): void;
|
|
@@ -270,4 +272,106 @@ declare class StackTraceError extends Error {
|
|
|
270
272
|
constructor(props: string | undefined, name: string, httpCode: HttpStatusCode | any, isOperational: boolean);
|
|
271
273
|
}
|
|
272
274
|
|
|
273
|
-
|
|
275
|
+
declare const CCodeError: {
|
|
276
|
+
CERT_NOT_YET_VALID: string;
|
|
277
|
+
CERT_HAS_EXPIRED: string;
|
|
278
|
+
CRL_NOT_YET_VALID: string;
|
|
279
|
+
CRL_HAS_EXPIRED: string;
|
|
280
|
+
CERT_REVOKED: string;
|
|
281
|
+
UNABLE_TO_GET_ISSUER_CERT: string;
|
|
282
|
+
UNABLE_TO_GET_ISSUER_CERT_LOCALLY: string;
|
|
283
|
+
DEPTH_ZERO_SELF_SIGNED_CERT: string;
|
|
284
|
+
SELF_SIGNED_CERT_IN_CHAIN: string;
|
|
285
|
+
CERT_CHAIN_TOO_LONG: string;
|
|
286
|
+
UNABLE_TO_GET_CRL: string;
|
|
287
|
+
UNABLE_TO_VERIFY_LEAF_SIGNATURE: string;
|
|
288
|
+
CERT_UNTRUSTED: string;
|
|
289
|
+
INVALID_CA: string;
|
|
290
|
+
PATH_LENGTH_EXCEEDED: string;
|
|
291
|
+
HOSTNAME_MISMATCH: string;
|
|
292
|
+
INVALID_PURPOSE: string;
|
|
293
|
+
CERT_REJECTED: string;
|
|
294
|
+
CERT_SIGNATURE_FAILURE: string;
|
|
295
|
+
CRL_SIGNATURE_FAILURE: string;
|
|
296
|
+
ERROR_IN_CERT_NOT_BEFORE_FIELD: string;
|
|
297
|
+
ERROR_IN_CERT_NOT_AFTER_FIELD: string;
|
|
298
|
+
ERROR_IN_CRL_LAST_UPDATE_FIELD: string;
|
|
299
|
+
ERROR_IN_CRL_NEXT_UPDATE_FIELD: string;
|
|
300
|
+
UNABLE_TO_DECRYPT_CERT_SIGNATURE: string;
|
|
301
|
+
UNABLE_TO_DECRYPT_CRL_SIGNATURE: string;
|
|
302
|
+
UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY: string;
|
|
303
|
+
OUT_OF_MEM: string;
|
|
304
|
+
ABORT_ERR: string;
|
|
305
|
+
ERR_ACCESS_DENIED: string;
|
|
306
|
+
ERR_AMBIGUOUS_ARGUMENT: string;
|
|
307
|
+
ERR_ARG_NOT_ITERABLE: string;
|
|
308
|
+
ERR_ASSERTION: string;
|
|
309
|
+
ERR_ASYNC_CALLBACK: string;
|
|
310
|
+
ERR_ASYNC_TYPE: string;
|
|
311
|
+
ERR_BROTLI_COMPRESSION_FAILED: string;
|
|
312
|
+
ERR_BROTLI_INVALID_PARAM: string;
|
|
313
|
+
ERR_BUFFER_CONTEXT_NOT_AVAILABLE: string;
|
|
314
|
+
ERR_BUFFER_OUT_OF_BOUNDS: string;
|
|
315
|
+
ERR_BUFFER_TOO_LARGE: string;
|
|
316
|
+
ERR_CANNOT_WATCH_SIGINT: string;
|
|
317
|
+
ERR_CHILD_CLOSED_BEFORE_REPLY: string;
|
|
318
|
+
ERR_CHILD_PROCESS_IPC_REQUIRED: string;
|
|
319
|
+
ERR_CHILD_PROCESS_STDIO_MAXBUFFER: string;
|
|
320
|
+
ERR_CLOSED_MESSAGE_PORT: string;
|
|
321
|
+
ERR_CONSOLE_WRITABLE_STREAM: string;
|
|
322
|
+
ERR_CONSTRUCT_CALL_INVALID: string;
|
|
323
|
+
ERR_CONSTRUCT_CALL_REQUIRED: string;
|
|
324
|
+
ERR_CONTEXT_NOT_INITIALIZED: string;
|
|
325
|
+
ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED: string;
|
|
326
|
+
ERR_CRYPTO_ECDH_INVALID_FORMAT: string;
|
|
327
|
+
ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY: string;
|
|
328
|
+
ERR_CRYPTO_ENGINE_UNKNOWN: string;
|
|
329
|
+
ERR_CRYPTO_FIPS_FORCED: string;
|
|
330
|
+
ERR_CRYPTO_FIPS_UNAVAILABLE: string;
|
|
331
|
+
ERR_CRYPTO_HASH_FINALIZED: string;
|
|
332
|
+
ERR_CRYPTO_HASH_UPDATE_FAILED: string;
|
|
333
|
+
ERR_CRYPTO_INCOMPATIBLE_KEY: string;
|
|
334
|
+
ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS: string;
|
|
335
|
+
ERR_CRYPTO_INITIALIZATION_FAILED: string;
|
|
336
|
+
ERR_CRYPTO_INVALID_AUTH_TAG: string;
|
|
337
|
+
ERR_CRYPTO_INVALID_COUNTER: string;
|
|
338
|
+
ERR_CRYPTO_INVALID_CURVE: string;
|
|
339
|
+
ERR_CRYPTO_INVALID_DIGEST: string;
|
|
340
|
+
ERR_CRYPTO_INVALID_IV: string;
|
|
341
|
+
ERR_CRYPTO_INVALID_JWK: string;
|
|
342
|
+
ERR_CRYPTO_INVALID_KEYLEN: string;
|
|
343
|
+
ERR_CRYPTO_INVALID_KEYPAIR: string;
|
|
344
|
+
ERR_CRYPTO_INVALID_KEYTYPE: string;
|
|
345
|
+
ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: string;
|
|
346
|
+
ERR_CRYPTO_INVALID_MESSAGELEN: string;
|
|
347
|
+
ERR_CRYPTO_INVALID_SCRYPT_PARAMS: string;
|
|
348
|
+
ERR_CRYPTO_INVALID_STATE: string;
|
|
349
|
+
ERR_CRYPTO_INVALID_TAG_LENGTH: string;
|
|
350
|
+
ERR_CRYPTO_JOB_INIT_FAILED: string;
|
|
351
|
+
ERR_CRYPTO_JWK_UNSUPPORTED_CURVE: string;
|
|
352
|
+
ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE: string;
|
|
353
|
+
ERR_CRYPTO_OPERATION_FAILED: string;
|
|
354
|
+
ERR_CRYPTO_PBKDF2_ERROR: string;
|
|
355
|
+
ERR_CRYPTO_SCRYPT_NOT_SUPPORTED: string;
|
|
356
|
+
ERR_CRYPTO_SIGN_KEY_REQUIRED: string;
|
|
357
|
+
ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH: string;
|
|
358
|
+
ERR_CRYPTO_UNKNOWN_CIPHER: string;
|
|
359
|
+
ERR_CRYPTO_UNKNOWN_DH_GROUP: string;
|
|
360
|
+
ERR_CRYPTO_UNSUPPORTED_OPERATION: string;
|
|
361
|
+
ERR_DEBUGGER_ERROR: string;
|
|
362
|
+
ERR_DEBUGGER_STARTUP_ERROR: string;
|
|
363
|
+
ERR_DIR_CLOSED: string;
|
|
364
|
+
ERR_DIR_CONCURRENT_OPERATION: string;
|
|
365
|
+
ERR_DLOPEN_DISABLED: string;
|
|
366
|
+
ERR_DLOPEN_FAILED: string;
|
|
367
|
+
ERR_DNS_SET_SERVERS_FAILED: string;
|
|
368
|
+
ERR_DOMAIN_CALLBACK_NOT_AVAILABLE: string;
|
|
369
|
+
ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE: string;
|
|
370
|
+
ERR_DUPLICATE_STARTUP_SNAPSHOT_MAIN_FUNCTION: string;
|
|
371
|
+
ERR_ENCODING_INVALID_ENCODED_DATA: string;
|
|
372
|
+
ERR_ENCODING_NOT_SUPPORTED: string;
|
|
373
|
+
ERR_EVAL_ESM_CANNOT_PRINT: string;
|
|
374
|
+
ERR_EVENT_RECURSION: string;
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
export { AssertionErrors, CCodeError, CErrorName, CEvent, CEventNameError, InternalErrors, JavaScriptErrors, OpenSSLErrors, ServerListenEventError, StackTraceError, SystemErrors };
|
package/dist/index.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ declare const CErrorName: {
|
|
|
40
40
|
uriError: string;
|
|
41
41
|
uncaughtException: string;
|
|
42
42
|
unhandledRejection: string;
|
|
43
|
+
transformError: string;
|
|
43
44
|
};
|
|
44
45
|
|
|
45
46
|
declare const CEvent: {
|
|
@@ -243,6 +244,7 @@ declare class AssertionErrors {
|
|
|
243
244
|
private stackTrace?;
|
|
244
245
|
private readonly localLanguage;
|
|
245
246
|
constructor(defaultLocalLang: string);
|
|
247
|
+
assertionError(error: any): void;
|
|
246
248
|
allError(error: any): void;
|
|
247
249
|
evalError(error: any): void;
|
|
248
250
|
rangeError(error: any): void;
|
|
@@ -270,4 +272,106 @@ declare class StackTraceError extends Error {
|
|
|
270
272
|
constructor(props: string | undefined, name: string, httpCode: HttpStatusCode | any, isOperational: boolean);
|
|
271
273
|
}
|
|
272
274
|
|
|
273
|
-
|
|
275
|
+
declare const CCodeError: {
|
|
276
|
+
CERT_NOT_YET_VALID: string;
|
|
277
|
+
CERT_HAS_EXPIRED: string;
|
|
278
|
+
CRL_NOT_YET_VALID: string;
|
|
279
|
+
CRL_HAS_EXPIRED: string;
|
|
280
|
+
CERT_REVOKED: string;
|
|
281
|
+
UNABLE_TO_GET_ISSUER_CERT: string;
|
|
282
|
+
UNABLE_TO_GET_ISSUER_CERT_LOCALLY: string;
|
|
283
|
+
DEPTH_ZERO_SELF_SIGNED_CERT: string;
|
|
284
|
+
SELF_SIGNED_CERT_IN_CHAIN: string;
|
|
285
|
+
CERT_CHAIN_TOO_LONG: string;
|
|
286
|
+
UNABLE_TO_GET_CRL: string;
|
|
287
|
+
UNABLE_TO_VERIFY_LEAF_SIGNATURE: string;
|
|
288
|
+
CERT_UNTRUSTED: string;
|
|
289
|
+
INVALID_CA: string;
|
|
290
|
+
PATH_LENGTH_EXCEEDED: string;
|
|
291
|
+
HOSTNAME_MISMATCH: string;
|
|
292
|
+
INVALID_PURPOSE: string;
|
|
293
|
+
CERT_REJECTED: string;
|
|
294
|
+
CERT_SIGNATURE_FAILURE: string;
|
|
295
|
+
CRL_SIGNATURE_FAILURE: string;
|
|
296
|
+
ERROR_IN_CERT_NOT_BEFORE_FIELD: string;
|
|
297
|
+
ERROR_IN_CERT_NOT_AFTER_FIELD: string;
|
|
298
|
+
ERROR_IN_CRL_LAST_UPDATE_FIELD: string;
|
|
299
|
+
ERROR_IN_CRL_NEXT_UPDATE_FIELD: string;
|
|
300
|
+
UNABLE_TO_DECRYPT_CERT_SIGNATURE: string;
|
|
301
|
+
UNABLE_TO_DECRYPT_CRL_SIGNATURE: string;
|
|
302
|
+
UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY: string;
|
|
303
|
+
OUT_OF_MEM: string;
|
|
304
|
+
ABORT_ERR: string;
|
|
305
|
+
ERR_ACCESS_DENIED: string;
|
|
306
|
+
ERR_AMBIGUOUS_ARGUMENT: string;
|
|
307
|
+
ERR_ARG_NOT_ITERABLE: string;
|
|
308
|
+
ERR_ASSERTION: string;
|
|
309
|
+
ERR_ASYNC_CALLBACK: string;
|
|
310
|
+
ERR_ASYNC_TYPE: string;
|
|
311
|
+
ERR_BROTLI_COMPRESSION_FAILED: string;
|
|
312
|
+
ERR_BROTLI_INVALID_PARAM: string;
|
|
313
|
+
ERR_BUFFER_CONTEXT_NOT_AVAILABLE: string;
|
|
314
|
+
ERR_BUFFER_OUT_OF_BOUNDS: string;
|
|
315
|
+
ERR_BUFFER_TOO_LARGE: string;
|
|
316
|
+
ERR_CANNOT_WATCH_SIGINT: string;
|
|
317
|
+
ERR_CHILD_CLOSED_BEFORE_REPLY: string;
|
|
318
|
+
ERR_CHILD_PROCESS_IPC_REQUIRED: string;
|
|
319
|
+
ERR_CHILD_PROCESS_STDIO_MAXBUFFER: string;
|
|
320
|
+
ERR_CLOSED_MESSAGE_PORT: string;
|
|
321
|
+
ERR_CONSOLE_WRITABLE_STREAM: string;
|
|
322
|
+
ERR_CONSTRUCT_CALL_INVALID: string;
|
|
323
|
+
ERR_CONSTRUCT_CALL_REQUIRED: string;
|
|
324
|
+
ERR_CONTEXT_NOT_INITIALIZED: string;
|
|
325
|
+
ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED: string;
|
|
326
|
+
ERR_CRYPTO_ECDH_INVALID_FORMAT: string;
|
|
327
|
+
ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY: string;
|
|
328
|
+
ERR_CRYPTO_ENGINE_UNKNOWN: string;
|
|
329
|
+
ERR_CRYPTO_FIPS_FORCED: string;
|
|
330
|
+
ERR_CRYPTO_FIPS_UNAVAILABLE: string;
|
|
331
|
+
ERR_CRYPTO_HASH_FINALIZED: string;
|
|
332
|
+
ERR_CRYPTO_HASH_UPDATE_FAILED: string;
|
|
333
|
+
ERR_CRYPTO_INCOMPATIBLE_KEY: string;
|
|
334
|
+
ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS: string;
|
|
335
|
+
ERR_CRYPTO_INITIALIZATION_FAILED: string;
|
|
336
|
+
ERR_CRYPTO_INVALID_AUTH_TAG: string;
|
|
337
|
+
ERR_CRYPTO_INVALID_COUNTER: string;
|
|
338
|
+
ERR_CRYPTO_INVALID_CURVE: string;
|
|
339
|
+
ERR_CRYPTO_INVALID_DIGEST: string;
|
|
340
|
+
ERR_CRYPTO_INVALID_IV: string;
|
|
341
|
+
ERR_CRYPTO_INVALID_JWK: string;
|
|
342
|
+
ERR_CRYPTO_INVALID_KEYLEN: string;
|
|
343
|
+
ERR_CRYPTO_INVALID_KEYPAIR: string;
|
|
344
|
+
ERR_CRYPTO_INVALID_KEYTYPE: string;
|
|
345
|
+
ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: string;
|
|
346
|
+
ERR_CRYPTO_INVALID_MESSAGELEN: string;
|
|
347
|
+
ERR_CRYPTO_INVALID_SCRYPT_PARAMS: string;
|
|
348
|
+
ERR_CRYPTO_INVALID_STATE: string;
|
|
349
|
+
ERR_CRYPTO_INVALID_TAG_LENGTH: string;
|
|
350
|
+
ERR_CRYPTO_JOB_INIT_FAILED: string;
|
|
351
|
+
ERR_CRYPTO_JWK_UNSUPPORTED_CURVE: string;
|
|
352
|
+
ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE: string;
|
|
353
|
+
ERR_CRYPTO_OPERATION_FAILED: string;
|
|
354
|
+
ERR_CRYPTO_PBKDF2_ERROR: string;
|
|
355
|
+
ERR_CRYPTO_SCRYPT_NOT_SUPPORTED: string;
|
|
356
|
+
ERR_CRYPTO_SIGN_KEY_REQUIRED: string;
|
|
357
|
+
ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH: string;
|
|
358
|
+
ERR_CRYPTO_UNKNOWN_CIPHER: string;
|
|
359
|
+
ERR_CRYPTO_UNKNOWN_DH_GROUP: string;
|
|
360
|
+
ERR_CRYPTO_UNSUPPORTED_OPERATION: string;
|
|
361
|
+
ERR_DEBUGGER_ERROR: string;
|
|
362
|
+
ERR_DEBUGGER_STARTUP_ERROR: string;
|
|
363
|
+
ERR_DIR_CLOSED: string;
|
|
364
|
+
ERR_DIR_CONCURRENT_OPERATION: string;
|
|
365
|
+
ERR_DLOPEN_DISABLED: string;
|
|
366
|
+
ERR_DLOPEN_FAILED: string;
|
|
367
|
+
ERR_DNS_SET_SERVERS_FAILED: string;
|
|
368
|
+
ERR_DOMAIN_CALLBACK_NOT_AVAILABLE: string;
|
|
369
|
+
ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE: string;
|
|
370
|
+
ERR_DUPLICATE_STARTUP_SNAPSHOT_MAIN_FUNCTION: string;
|
|
371
|
+
ERR_ENCODING_INVALID_ENCODED_DATA: string;
|
|
372
|
+
ERR_ENCODING_NOT_SUPPORTED: string;
|
|
373
|
+
ERR_EVAL_ESM_CANNOT_PRINT: string;
|
|
374
|
+
ERR_EVENT_RECURSION: string;
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
export { AssertionErrors, CCodeError, CErrorName, CEvent, CEventNameError, InternalErrors, JavaScriptErrors, OpenSSLErrors, ServerListenEventError, StackTraceError, SystemErrors };
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,8 @@ var CErrorName = {
|
|
|
36
36
|
typeError: "TypeError",
|
|
37
37
|
uriError: "URIError",
|
|
38
38
|
uncaughtException: "uncaughtException",
|
|
39
|
-
unhandledRejection: "unhandledRejection"
|
|
39
|
+
unhandledRejection: "unhandledRejection",
|
|
40
|
+
transformError: "TransformError"
|
|
40
41
|
};
|
|
41
42
|
|
|
42
43
|
// src/domains/constants/event.constant.ts
|
|
@@ -169,7 +170,7 @@ var ServerListenEventError = class {
|
|
|
169
170
|
this.logger.error(
|
|
170
171
|
this.stackTrace.message,
|
|
171
172
|
TranslationLoader2.t("webServer", this.localeLanguage),
|
|
172
|
-
TranslationLoader2.t("
|
|
173
|
+
TranslationLoader2.t("badPort", this.localeLanguage),
|
|
173
174
|
this.stackTrace.stack,
|
|
174
175
|
status.BAD_REQUEST
|
|
175
176
|
);
|
|
@@ -422,21 +423,18 @@ var ServerListenEventError = class {
|
|
|
422
423
|
* @param promise
|
|
423
424
|
*/
|
|
424
425
|
promiseRejectionHandled(promise) {
|
|
425
|
-
|
|
426
|
-
this.
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
this.
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
);
|
|
438
|
-
} catch (err) {
|
|
439
|
-
}
|
|
426
|
+
this.stackTrace = this.traceError(
|
|
427
|
+
TranslationLoader2.t("promise", this.localeLanguage, { promise }),
|
|
428
|
+
TranslationLoader2.t("rejectionPromise", this.localeLanguage, { promise }),
|
|
429
|
+
status.SERVICE_UNAVAILABLE
|
|
430
|
+
);
|
|
431
|
+
this.logger.error(
|
|
432
|
+
this.stackTrace.message,
|
|
433
|
+
"PromiseRejectionHandled",
|
|
434
|
+
this.stackTrace.name,
|
|
435
|
+
promise,
|
|
436
|
+
status.SERVICE_UNAVAILABLE
|
|
437
|
+
);
|
|
440
438
|
}
|
|
441
439
|
/**
|
|
442
440
|
*
|
|
@@ -484,7 +482,7 @@ var ServerListenEventError = class {
|
|
|
484
482
|
this.stackTrace.message,
|
|
485
483
|
"UnhandledRejection",
|
|
486
484
|
this.stackTrace.name,
|
|
487
|
-
|
|
485
|
+
`reason: ${reason} - promise: ${promise}`,
|
|
488
486
|
status.SERVICE_UNAVAILABLE
|
|
489
487
|
);
|
|
490
488
|
}
|
|
@@ -502,7 +500,7 @@ var ServerListenEventError = class {
|
|
|
502
500
|
this.stackTrace.message,
|
|
503
501
|
TranslationLoader2.t("warning", this.localeLanguage, { warning }),
|
|
504
502
|
this.stackTrace.name,
|
|
505
|
-
|
|
503
|
+
`warning: ${warning}`,
|
|
506
504
|
status.SERVICE_UNAVAILABLE
|
|
507
505
|
);
|
|
508
506
|
}
|
|
@@ -520,7 +518,7 @@ var ServerListenEventError = class {
|
|
|
520
518
|
this.stackTrace.message,
|
|
521
519
|
"Message",
|
|
522
520
|
this.stackTrace.name,
|
|
523
|
-
|
|
521
|
+
`message: ${message}`,
|
|
524
522
|
status.SERVICE_UNAVAILABLE
|
|
525
523
|
);
|
|
526
524
|
}
|
|
@@ -540,7 +538,7 @@ var ServerListenEventError = class {
|
|
|
540
538
|
this.stackTrace.message,
|
|
541
539
|
"multipleResolves",
|
|
542
540
|
this.stackTrace.name,
|
|
543
|
-
|
|
541
|
+
`type: ${type}, promise: ${promise}, reason: ${reason}`,
|
|
544
542
|
status.SERVICE_UNAVAILABLE
|
|
545
543
|
);
|
|
546
544
|
}
|
|
@@ -568,7 +566,7 @@ var ServerListenEventError = class {
|
|
|
568
566
|
this.stackTrace.message,
|
|
569
567
|
"SIGTERM",
|
|
570
568
|
this.stackTrace.name,
|
|
571
|
-
|
|
569
|
+
signal.toString(),
|
|
572
570
|
status.NOT_ACCEPTABLE
|
|
573
571
|
);
|
|
574
572
|
process.exit(0);
|
|
@@ -657,7 +655,7 @@ var JavaScriptErrors = class {
|
|
|
657
655
|
TranslationLoader3.t(this.stackTrace.message, this.localLanguage),
|
|
658
656
|
"EvalError",
|
|
659
657
|
this.stackTrace.name,
|
|
660
|
-
|
|
658
|
+
error.stack,
|
|
661
659
|
status2.INTERNAL_SERVER_ERROR
|
|
662
660
|
);
|
|
663
661
|
}
|
|
@@ -667,7 +665,7 @@ var JavaScriptErrors = class {
|
|
|
667
665
|
TranslationLoader3.t(this.stackTrace.message, this.localLanguage),
|
|
668
666
|
"RangeError",
|
|
669
667
|
this.stackTrace.name,
|
|
670
|
-
|
|
668
|
+
error.stack,
|
|
671
669
|
status2.INTERNAL_SERVER_ERROR
|
|
672
670
|
);
|
|
673
671
|
}
|
|
@@ -677,7 +675,7 @@ var JavaScriptErrors = class {
|
|
|
677
675
|
TranslationLoader3.t(this.stackTrace.message, this.localLanguage),
|
|
678
676
|
"ReferenceError",
|
|
679
677
|
this.stackTrace.name,
|
|
680
|
-
|
|
678
|
+
error.stack,
|
|
681
679
|
status2.INTERNAL_SERVER_ERROR
|
|
682
680
|
);
|
|
683
681
|
}
|
|
@@ -687,7 +685,7 @@ var JavaScriptErrors = class {
|
|
|
687
685
|
TranslationLoader3.t(this.stackTrace.message, this.localLanguage),
|
|
688
686
|
"SyntaxError",
|
|
689
687
|
this.stackTrace.name,
|
|
690
|
-
|
|
688
|
+
error.stack,
|
|
691
689
|
status2.INTERNAL_SERVER_ERROR
|
|
692
690
|
);
|
|
693
691
|
}
|
|
@@ -697,7 +695,7 @@ var JavaScriptErrors = class {
|
|
|
697
695
|
TranslationLoader3.t(this.stackTrace.message, this.localLanguage),
|
|
698
696
|
"TypeError",
|
|
699
697
|
this.stackTrace.name,
|
|
700
|
-
|
|
698
|
+
error.stack,
|
|
701
699
|
status2.INTERNAL_SERVER_ERROR
|
|
702
700
|
);
|
|
703
701
|
}
|
|
@@ -707,7 +705,7 @@ var JavaScriptErrors = class {
|
|
|
707
705
|
TranslationLoader3.t(this.stackTrace.message, this.localLanguage),
|
|
708
706
|
"URIError",
|
|
709
707
|
this.stackTrace.name,
|
|
710
|
-
|
|
708
|
+
error.stack,
|
|
711
709
|
status2.INTERNAL_SERVER_ERROR
|
|
712
710
|
);
|
|
713
711
|
}
|
|
@@ -743,7 +741,7 @@ var SystemErrors = class {
|
|
|
743
741
|
TranslationLoader4.t(this.stackTrace.message, this.localLanguage),
|
|
744
742
|
"EADDRINUSE",
|
|
745
743
|
this.stackTrace.name,
|
|
746
|
-
|
|
744
|
+
error.stack,
|
|
747
745
|
status3.INTERNAL_SERVER_ERROR
|
|
748
746
|
);
|
|
749
747
|
}
|
|
@@ -753,7 +751,7 @@ var SystemErrors = class {
|
|
|
753
751
|
TranslationLoader4.t(this.stackTrace.message, this.localLanguage),
|
|
754
752
|
"ECONNREFUSED",
|
|
755
753
|
this.stackTrace.name,
|
|
756
|
-
|
|
754
|
+
error.stack,
|
|
757
755
|
status3.INTERNAL_SERVER_ERROR
|
|
758
756
|
);
|
|
759
757
|
}
|
|
@@ -763,7 +761,7 @@ var SystemErrors = class {
|
|
|
763
761
|
TranslationLoader4.t(this.stackTrace.message, this.localLanguage),
|
|
764
762
|
"ECONNRESET",
|
|
765
763
|
this.stackTrace.name,
|
|
766
|
-
|
|
764
|
+
error.stack,
|
|
767
765
|
status3.INTERNAL_SERVER_ERROR
|
|
768
766
|
);
|
|
769
767
|
}
|
|
@@ -773,7 +771,7 @@ var SystemErrors = class {
|
|
|
773
771
|
TranslationLoader4.t(this.stackTrace.message, this.localLanguage),
|
|
774
772
|
"EEXIST",
|
|
775
773
|
this.stackTrace.name,
|
|
776
|
-
|
|
774
|
+
error.stack,
|
|
777
775
|
status3.INTERNAL_SERVER_ERROR
|
|
778
776
|
);
|
|
779
777
|
}
|
|
@@ -783,7 +781,7 @@ var SystemErrors = class {
|
|
|
783
781
|
TranslationLoader4.t(this.stackTrace.message, this.localLanguage),
|
|
784
782
|
"EISDIR",
|
|
785
783
|
this.stackTrace.name,
|
|
786
|
-
|
|
784
|
+
error.stack,
|
|
787
785
|
status3.INTERNAL_SERVER_ERROR
|
|
788
786
|
);
|
|
789
787
|
}
|
|
@@ -793,7 +791,7 @@ var SystemErrors = class {
|
|
|
793
791
|
TranslationLoader4.t(this.stackTrace.message, this.localLanguage),
|
|
794
792
|
"EMFILE",
|
|
795
793
|
this.stackTrace.name,
|
|
796
|
-
|
|
794
|
+
error.stack,
|
|
797
795
|
status3.INTERNAL_SERVER_ERROR
|
|
798
796
|
);
|
|
799
797
|
}
|
|
@@ -803,7 +801,7 @@ var SystemErrors = class {
|
|
|
803
801
|
TranslationLoader4.t(this.stackTrace.message, this.localLanguage),
|
|
804
802
|
"ENOENT",
|
|
805
803
|
this.stackTrace.name,
|
|
806
|
-
|
|
804
|
+
error.stack,
|
|
807
805
|
status3.INTERNAL_SERVER_ERROR
|
|
808
806
|
);
|
|
809
807
|
}
|
|
@@ -813,7 +811,7 @@ var SystemErrors = class {
|
|
|
813
811
|
TranslationLoader4.t(this.stackTrace.message, this.localLanguage),
|
|
814
812
|
"ENOTDIR",
|
|
815
813
|
this.stackTrace.name,
|
|
816
|
-
|
|
814
|
+
error.stack,
|
|
817
815
|
status3.INTERNAL_SERVER_ERROR
|
|
818
816
|
);
|
|
819
817
|
}
|
|
@@ -823,7 +821,7 @@ var SystemErrors = class {
|
|
|
823
821
|
TranslationLoader4.t(this.stackTrace.message, this.localLanguage),
|
|
824
822
|
"ENOTEMPTY",
|
|
825
823
|
this.stackTrace.name,
|
|
826
|
-
|
|
824
|
+
error.stack,
|
|
827
825
|
status3.INTERNAL_SERVER_ERROR
|
|
828
826
|
);
|
|
829
827
|
}
|
|
@@ -833,7 +831,7 @@ var SystemErrors = class {
|
|
|
833
831
|
TranslationLoader4.t(this.stackTrace.message, this.localLanguage),
|
|
834
832
|
"EPERM",
|
|
835
833
|
this.stackTrace.name,
|
|
836
|
-
|
|
834
|
+
error.stack,
|
|
837
835
|
status3.INTERNAL_SERVER_ERROR
|
|
838
836
|
);
|
|
839
837
|
}
|
|
@@ -843,7 +841,7 @@ var SystemErrors = class {
|
|
|
843
841
|
TranslationLoader4.t(this.stackTrace.message, this.localLanguage),
|
|
844
842
|
"EPIPE",
|
|
845
843
|
this.stackTrace.name,
|
|
846
|
-
|
|
844
|
+
error.stack,
|
|
847
845
|
status3.INTERNAL_SERVER_ERROR
|
|
848
846
|
);
|
|
849
847
|
}
|
|
@@ -853,7 +851,7 @@ var SystemErrors = class {
|
|
|
853
851
|
TranslationLoader4.t(this.stackTrace.message, this.localLanguage),
|
|
854
852
|
"ETIMEDOUT",
|
|
855
853
|
this.stackTrace.name,
|
|
856
|
-
|
|
854
|
+
error.stack,
|
|
857
855
|
status3.INTERNAL_SERVER_ERROR
|
|
858
856
|
);
|
|
859
857
|
}
|
|
@@ -889,7 +887,7 @@ var OpenSSLErrors = class {
|
|
|
889
887
|
TranslationLoader5.t(this.stackTrace.message, this.localLanguage),
|
|
890
888
|
"ERR_OSSL_BAD_DECRYPT",
|
|
891
889
|
this.stackTrace.name,
|
|
892
|
-
|
|
890
|
+
error.stack,
|
|
893
891
|
status4.INTERNAL_SERVER_ERROR
|
|
894
892
|
);
|
|
895
893
|
}
|
|
@@ -899,7 +897,7 @@ var OpenSSLErrors = class {
|
|
|
899
897
|
TranslationLoader5.t(this.stackTrace.message, this.localLanguage),
|
|
900
898
|
"ERR_OSSL_WRONG_FINAL_BLOCK_LENGTH",
|
|
901
899
|
this.stackTrace.name,
|
|
902
|
-
|
|
900
|
+
error.stack,
|
|
903
901
|
status4.INTERNAL_SERVER_ERROR
|
|
904
902
|
);
|
|
905
903
|
}
|
|
@@ -935,7 +933,7 @@ var InternalErrors = class {
|
|
|
935
933
|
TranslationLoader6.t(this.stackTrace.message, this.localLanguage),
|
|
936
934
|
"ERR_INVALID_CALLBACK",
|
|
937
935
|
this.stackTrace.name,
|
|
938
|
-
|
|
936
|
+
error.stack,
|
|
939
937
|
status5.INTERNAL_SERVER_ERROR
|
|
940
938
|
);
|
|
941
939
|
}
|
|
@@ -945,7 +943,7 @@ var InternalErrors = class {
|
|
|
945
943
|
TranslationLoader6.t(this.stackTrace.message, this.localLanguage),
|
|
946
944
|
"ERR_HTTP_HEADERS_SENT",
|
|
947
945
|
this.stackTrace.name,
|
|
948
|
-
|
|
946
|
+
error.stack,
|
|
949
947
|
status5.INTERNAL_SERVER_ERROR
|
|
950
948
|
);
|
|
951
949
|
}
|
|
@@ -955,7 +953,7 @@ var InternalErrors = class {
|
|
|
955
953
|
TranslationLoader6.t(this.stackTrace.message, this.localLanguage),
|
|
956
954
|
"ERR_STREAM_DESTROYED",
|
|
957
955
|
this.stackTrace.name,
|
|
958
|
-
|
|
956
|
+
error.stack,
|
|
959
957
|
status5.INTERNAL_SERVER_ERROR
|
|
960
958
|
);
|
|
961
959
|
}
|
|
@@ -965,7 +963,7 @@ var InternalErrors = class {
|
|
|
965
963
|
TranslationLoader6.t(this.stackTrace.message, this.localLanguage),
|
|
966
964
|
"ERR_TLS_CERT_ALTNAME_INVALID",
|
|
967
965
|
this.stackTrace.name,
|
|
968
|
-
|
|
966
|
+
error.stack,
|
|
969
967
|
status5.INTERNAL_SERVER_ERROR
|
|
970
968
|
);
|
|
971
969
|
}
|
|
@@ -975,7 +973,7 @@ var InternalErrors = class {
|
|
|
975
973
|
TranslationLoader6.t(this.stackTrace.message, this.localLanguage),
|
|
976
974
|
"ERR_UNSUPPORTED_ESM_URL_SCHEME",
|
|
977
975
|
this.stackTrace.name,
|
|
978
|
-
|
|
976
|
+
error.stack,
|
|
979
977
|
status5.INTERNAL_SERVER_ERROR
|
|
980
978
|
);
|
|
981
979
|
}
|
|
@@ -995,6 +993,16 @@ var AssertionErrors = class {
|
|
|
995
993
|
constructor(defaultLocalLang) {
|
|
996
994
|
this.localLanguage = defaultLocalLang;
|
|
997
995
|
}
|
|
996
|
+
assertionError(error) {
|
|
997
|
+
this.stackTrace = this.traceError(error.message, error.name, status6.INTERNAL_SERVER_ERROR);
|
|
998
|
+
this.logger.error(
|
|
999
|
+
TranslationLoader7.t(this.stackTrace.message, this.localLanguage),
|
|
1000
|
+
"AssertionError",
|
|
1001
|
+
this.stackTrace.name,
|
|
1002
|
+
error.stack,
|
|
1003
|
+
status6.INTERNAL_SERVER_ERROR
|
|
1004
|
+
);
|
|
1005
|
+
}
|
|
998
1006
|
allError(error) {
|
|
999
1007
|
this.stackTrace = this.traceError(error.message, error.name, status6.INTERNAL_SERVER_ERROR);
|
|
1000
1008
|
this.logger.error(
|
|
@@ -1011,7 +1019,7 @@ var AssertionErrors = class {
|
|
|
1011
1019
|
TranslationLoader7.t(this.stackTrace.message, this.localLanguage),
|
|
1012
1020
|
"EvalError",
|
|
1013
1021
|
this.stackTrace.name,
|
|
1014
|
-
|
|
1022
|
+
error.stack,
|
|
1015
1023
|
status6.INTERNAL_SERVER_ERROR
|
|
1016
1024
|
);
|
|
1017
1025
|
}
|
|
@@ -1021,7 +1029,7 @@ var AssertionErrors = class {
|
|
|
1021
1029
|
TranslationLoader7.t(this.stackTrace.message, this.localLanguage),
|
|
1022
1030
|
"RangeError",
|
|
1023
1031
|
this.stackTrace.name,
|
|
1024
|
-
|
|
1032
|
+
error.stack,
|
|
1025
1033
|
status6.INTERNAL_SERVER_ERROR
|
|
1026
1034
|
);
|
|
1027
1035
|
}
|
|
@@ -1031,7 +1039,7 @@ var AssertionErrors = class {
|
|
|
1031
1039
|
TranslationLoader7.t(this.stackTrace.message, this.localLanguage),
|
|
1032
1040
|
"ReferenceError",
|
|
1033
1041
|
this.stackTrace.name,
|
|
1034
|
-
|
|
1042
|
+
error.stack,
|
|
1035
1043
|
status6.INTERNAL_SERVER_ERROR
|
|
1036
1044
|
);
|
|
1037
1045
|
}
|
|
@@ -1041,7 +1049,7 @@ var AssertionErrors = class {
|
|
|
1041
1049
|
TranslationLoader7.t(this.stackTrace.message, this.localLanguage),
|
|
1042
1050
|
"SyntaxError",
|
|
1043
1051
|
this.stackTrace.name,
|
|
1044
|
-
|
|
1052
|
+
error.stack,
|
|
1045
1053
|
status6.INTERNAL_SERVER_ERROR
|
|
1046
1054
|
);
|
|
1047
1055
|
}
|
|
@@ -1051,7 +1059,7 @@ var AssertionErrors = class {
|
|
|
1051
1059
|
TranslationLoader7.t(this.stackTrace.message, this.localLanguage),
|
|
1052
1060
|
"TypeError",
|
|
1053
1061
|
this.stackTrace.name,
|
|
1054
|
-
|
|
1062
|
+
error.stack,
|
|
1055
1063
|
status6.INTERNAL_SERVER_ERROR
|
|
1056
1064
|
);
|
|
1057
1065
|
}
|
|
@@ -1061,7 +1069,7 @@ var AssertionErrors = class {
|
|
|
1061
1069
|
TranslationLoader7.t(this.stackTrace.message, this.localLanguage),
|
|
1062
1070
|
"URIError",
|
|
1063
1071
|
this.stackTrace.name,
|
|
1064
|
-
|
|
1072
|
+
error.stack,
|
|
1065
1073
|
status6.INTERNAL_SERVER_ERROR
|
|
1066
1074
|
);
|
|
1067
1075
|
}
|
|
@@ -1069,8 +1077,112 @@ var AssertionErrors = class {
|
|
|
1069
1077
|
return new StackTraceError(props, name, status7, true);
|
|
1070
1078
|
}
|
|
1071
1079
|
};
|
|
1080
|
+
|
|
1081
|
+
// src/domains/constants/codeError.constant.ts
|
|
1082
|
+
var CCodeError = {
|
|
1083
|
+
CERT_NOT_YET_VALID: "CERT_NOT_YET_VALID",
|
|
1084
|
+
CERT_HAS_EXPIRED: "CERT_HAS_EXPIRED",
|
|
1085
|
+
CRL_NOT_YET_VALID: "CRL_NOT_YET_VALID",
|
|
1086
|
+
CRL_HAS_EXPIRED: "CRL_HAS_EXPIRED",
|
|
1087
|
+
CERT_REVOKED: "CERT_REVOKED",
|
|
1088
|
+
UNABLE_TO_GET_ISSUER_CERT: "UNABLE_TO_GET_ISSUER_CERT",
|
|
1089
|
+
UNABLE_TO_GET_ISSUER_CERT_LOCALLY: "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
1090
|
+
DEPTH_ZERO_SELF_SIGNED_CERT: "DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
1091
|
+
SELF_SIGNED_CERT_IN_CHAIN: "SELF_SIGNED_CERT_IN_CHAIN",
|
|
1092
|
+
CERT_CHAIN_TOO_LONG: "CERT_CHAIN_TOO_LONG",
|
|
1093
|
+
UNABLE_TO_GET_CRL: "UNABLE_TO_GET_CRL",
|
|
1094
|
+
UNABLE_TO_VERIFY_LEAF_SIGNATURE: "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
1095
|
+
CERT_UNTRUSTED: "CERT_UNTRUSTED",
|
|
1096
|
+
INVALID_CA: "INVALID_CA",
|
|
1097
|
+
PATH_LENGTH_EXCEEDED: "PATH_LENGTH_EXCEEDED",
|
|
1098
|
+
HOSTNAME_MISMATCH: "HOSTNAME_MISMATCH",
|
|
1099
|
+
INVALID_PURPOSE: "INVALID_PURPOSE",
|
|
1100
|
+
CERT_REJECTED: "CERT_REJECTED",
|
|
1101
|
+
CERT_SIGNATURE_FAILURE: "CERT_SIGNATURE_FAILURE",
|
|
1102
|
+
CRL_SIGNATURE_FAILURE: "CRL_SIGNATURE_FAILURE",
|
|
1103
|
+
ERROR_IN_CERT_NOT_BEFORE_FIELD: "ERROR_IN_CERT_NOT_BEFORE_FIELD",
|
|
1104
|
+
ERROR_IN_CERT_NOT_AFTER_FIELD: "ERROR_IN_CERT_NOT_AFTER_FIELD",
|
|
1105
|
+
ERROR_IN_CRL_LAST_UPDATE_FIELD: "ERROR_IN_CRL_LAST_UPDATE_FIELD",
|
|
1106
|
+
ERROR_IN_CRL_NEXT_UPDATE_FIELD: "ERROR_IN_CRL_NEXT_UPDATE_FIELD",
|
|
1107
|
+
UNABLE_TO_DECRYPT_CERT_SIGNATURE: "UNABLE_TO_DECRYPT_CERT_SIGNATURE",
|
|
1108
|
+
UNABLE_TO_DECRYPT_CRL_SIGNATURE: "UNABLE_TO_DECRYPT_CRL_SIGNATURE",
|
|
1109
|
+
UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY: "UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY",
|
|
1110
|
+
OUT_OF_MEM: "OUT_OF_MEM",
|
|
1111
|
+
ABORT_ERR: "ABORT_ERR",
|
|
1112
|
+
ERR_ACCESS_DENIED: "ERR_ACCESS_DENIED",
|
|
1113
|
+
ERR_AMBIGUOUS_ARGUMENT: "ERR_AMBIGUOUS_ARGUMENT",
|
|
1114
|
+
ERR_ARG_NOT_ITERABLE: "ERR_ARG_NOT_ITERABLE",
|
|
1115
|
+
ERR_ASSERTION: "ERR_ASSERTION",
|
|
1116
|
+
ERR_ASYNC_CALLBACK: "ERR_ASYNC_CALLBACK",
|
|
1117
|
+
ERR_ASYNC_TYPE: "ERR_ASYNC_TYPE",
|
|
1118
|
+
ERR_BROTLI_COMPRESSION_FAILED: "ERR_BROTLI_COMPRESSION_FAILED",
|
|
1119
|
+
ERR_BROTLI_INVALID_PARAM: "ERR_BROTLI_INVALID_PARAM",
|
|
1120
|
+
ERR_BUFFER_CONTEXT_NOT_AVAILABLE: "ERR_BUFFER_CONTEXT_NOT_AVAILABLE",
|
|
1121
|
+
ERR_BUFFER_OUT_OF_BOUNDS: "ERR_BUFFER_OUT_OF_BOUNDS",
|
|
1122
|
+
ERR_BUFFER_TOO_LARGE: "ERR_BUFFER_TOO_LARGE",
|
|
1123
|
+
ERR_CANNOT_WATCH_SIGINT: "ERR_CANNOT_WATCH_SIGINT",
|
|
1124
|
+
ERR_CHILD_CLOSED_BEFORE_REPLY: "ERR_CHILD_CLOSED_BEFORE_REPLY",
|
|
1125
|
+
ERR_CHILD_PROCESS_IPC_REQUIRED: "ERR_CHILD_PROCESS_IPC_REQUIRED",
|
|
1126
|
+
ERR_CHILD_PROCESS_STDIO_MAXBUFFER: "ERR_CHILD_PROCESS_STDIO_MAXBUFFER",
|
|
1127
|
+
ERR_CLOSED_MESSAGE_PORT: "ERR_CLOSED_MESSAGE_PORT",
|
|
1128
|
+
ERR_CONSOLE_WRITABLE_STREAM: "ERR_CONSOLE_WRITABLE_STREAM",
|
|
1129
|
+
ERR_CONSTRUCT_CALL_INVALID: "ERR_CONSTRUCT_CALL_INVALID",
|
|
1130
|
+
ERR_CONSTRUCT_CALL_REQUIRED: "ERR_CONSTRUCT_CALL_REQUIRED",
|
|
1131
|
+
ERR_CONTEXT_NOT_INITIALIZED: "ERR_CONTEXT_NOT_INITIALIZED",
|
|
1132
|
+
ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED: "ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED",
|
|
1133
|
+
ERR_CRYPTO_ECDH_INVALID_FORMAT: "ERR_CRYPTO_ECDH_INVALID_FORMAT",
|
|
1134
|
+
ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY: "ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY",
|
|
1135
|
+
ERR_CRYPTO_ENGINE_UNKNOWN: "ERR_CRYPTO_ENGINE_UNKNOWN",
|
|
1136
|
+
ERR_CRYPTO_FIPS_FORCED: "ERR_CRYPTO_FIPS_FORCED",
|
|
1137
|
+
ERR_CRYPTO_FIPS_UNAVAILABLE: "ERR_CRYPTO_FIPS_UNAVAILABLE",
|
|
1138
|
+
ERR_CRYPTO_HASH_FINALIZED: "ERR_CRYPTO_HASH_FINALIZED",
|
|
1139
|
+
ERR_CRYPTO_HASH_UPDATE_FAILED: "ERR_CRYPTO_HASH_UPDATE_FAILED",
|
|
1140
|
+
ERR_CRYPTO_INCOMPATIBLE_KEY: "ERR_CRYPTO_INCOMPATIBLE_KEY",
|
|
1141
|
+
ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS: "ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS",
|
|
1142
|
+
ERR_CRYPTO_INITIALIZATION_FAILED: "ERR_CRYPTO_INITIALIZATION_FAILED",
|
|
1143
|
+
ERR_CRYPTO_INVALID_AUTH_TAG: "ERR_CRYPTO_INVALID_AUTH_TAG",
|
|
1144
|
+
ERR_CRYPTO_INVALID_COUNTER: "ERR_CRYPTO_INVALID_COUNTER",
|
|
1145
|
+
ERR_CRYPTO_INVALID_CURVE: "ERR_CRYPTO_INVALID_CURVE",
|
|
1146
|
+
ERR_CRYPTO_INVALID_DIGEST: "ERR_CRYPTO_INVALID_DIGEST",
|
|
1147
|
+
ERR_CRYPTO_INVALID_IV: "ERR_CRYPTO_INVALID_IV",
|
|
1148
|
+
ERR_CRYPTO_INVALID_JWK: "ERR_CRYPTO_INVALID_JWK",
|
|
1149
|
+
ERR_CRYPTO_INVALID_KEYLEN: "ERR_CRYPTO_INVALID_KEYLEN",
|
|
1150
|
+
ERR_CRYPTO_INVALID_KEYPAIR: "ERR_CRYPTO_INVALID_KEYPAIR",
|
|
1151
|
+
ERR_CRYPTO_INVALID_KEYTYPE: "ERR_CRYPTO_INVALID_KEYTYPE",
|
|
1152
|
+
ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: "ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE",
|
|
1153
|
+
ERR_CRYPTO_INVALID_MESSAGELEN: "ERR_CRYPTO_INVALID_MESSAGELEN",
|
|
1154
|
+
ERR_CRYPTO_INVALID_SCRYPT_PARAMS: "ERR_CRYPTO_INVALID_SCRYPT_PARAMS",
|
|
1155
|
+
ERR_CRYPTO_INVALID_STATE: "ERR_CRYPTO_INVALID_STATE",
|
|
1156
|
+
ERR_CRYPTO_INVALID_TAG_LENGTH: "ERR_CRYPTO_INVALID_TAG_LENGTH",
|
|
1157
|
+
ERR_CRYPTO_JOB_INIT_FAILED: "ERR_CRYPTO_JOB_INIT_FAILED",
|
|
1158
|
+
ERR_CRYPTO_JWK_UNSUPPORTED_CURVE: "ERR_CRYPTO_JWK_UNSUPPORTED_CURVE",
|
|
1159
|
+
ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE: "ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE",
|
|
1160
|
+
ERR_CRYPTO_OPERATION_FAILED: "ERR_CRYPTO_OPERATION_FAILED",
|
|
1161
|
+
ERR_CRYPTO_PBKDF2_ERROR: "ERR_CRYPTO_PBKDF2_ERROR",
|
|
1162
|
+
ERR_CRYPTO_SCRYPT_NOT_SUPPORTED: "ERR_CRYPTO_SCRYPT_NOT_SUPPORTED",
|
|
1163
|
+
ERR_CRYPTO_SIGN_KEY_REQUIRED: "ERR_CRYPTO_SIGN_KEY_REQUIRED",
|
|
1164
|
+
ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH: "ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH",
|
|
1165
|
+
ERR_CRYPTO_UNKNOWN_CIPHER: "ERR_CRYPTO_UNKNOWN_CIPHER",
|
|
1166
|
+
ERR_CRYPTO_UNKNOWN_DH_GROUP: "ERR_CRYPTO_UNKNOWN_DH_GROUP",
|
|
1167
|
+
ERR_CRYPTO_UNSUPPORTED_OPERATION: "ERR_CRYPTO_UNSUPPORTED_OPERATION",
|
|
1168
|
+
ERR_DEBUGGER_ERROR: "ERR_DEBUGGER_ERROR",
|
|
1169
|
+
ERR_DEBUGGER_STARTUP_ERROR: "ERR_DEBUGGER_STARTUP_ERROR",
|
|
1170
|
+
ERR_DIR_CLOSED: "ERR_DIR_CLOSED",
|
|
1171
|
+
ERR_DIR_CONCURRENT_OPERATION: "ERR_DIR_CONCURRENT_OPERATION",
|
|
1172
|
+
ERR_DLOPEN_DISABLED: "ERR_DLOPEN_DISABLED",
|
|
1173
|
+
ERR_DLOPEN_FAILED: "ERR_DLOPEN_FAILED",
|
|
1174
|
+
ERR_DNS_SET_SERVERS_FAILED: "ERR_DNS_SET_SERVERS_FAILED",
|
|
1175
|
+
ERR_DOMAIN_CALLBACK_NOT_AVAILABLE: "ERR_DOMAIN_CALLBACK_NOT_AVAILABLE",
|
|
1176
|
+
ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE: "ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE",
|
|
1177
|
+
ERR_DUPLICATE_STARTUP_SNAPSHOT_MAIN_FUNCTION: "ERR_DUPLICATE_STARTUP_SNAPSHOT_MAIN_FUNCTION",
|
|
1178
|
+
ERR_ENCODING_INVALID_ENCODED_DATA: "ERR_ENCODING_INVALID_ENCODED_DATA",
|
|
1179
|
+
ERR_ENCODING_NOT_SUPPORTED: "ERR_ENCODING_NOT_SUPPORTED",
|
|
1180
|
+
ERR_EVAL_ESM_CANNOT_PRINT: "ERR_EVAL_ESM_CANNOT_PRINT",
|
|
1181
|
+
ERR_EVENT_RECURSION: "ERR_EVENT_RECURSION"
|
|
1182
|
+
};
|
|
1072
1183
|
export {
|
|
1073
1184
|
AssertionErrors,
|
|
1185
|
+
CCodeError,
|
|
1074
1186
|
CErrorName,
|
|
1075
1187
|
CEvent,
|
|
1076
1188
|
CEventNameError,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"webHost": "host",
|
|
6
6
|
"hostNotFound": "not found",
|
|
7
7
|
"badHost": "bad host {badHost}",
|
|
8
|
-
"badPort": "bad port
|
|
8
|
+
"badPort": "bad port or undefined",
|
|
9
9
|
"errorPort": "The port is not correct. Please define a right port with number port.",
|
|
10
10
|
"errorHost": "The host can't be empty or blank. Please define a string host in .env",
|
|
11
11
|
"serverStart": "Server start",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"webHost": "hôte",
|
|
6
6
|
"badHost": "mauvais hôte",
|
|
7
7
|
"hostNotFound": "introuvable",
|
|
8
|
-
"badPort": "mauvais port",
|
|
8
|
+
"badPort": "mauvais port or non défini",
|
|
9
9
|
"errorPort": "Le port n'est pas correcte. Veuillez définir un port correct avec le numéro de port.",
|
|
10
10
|
"errorHost": "L'hôte ne peut être vide. Veuillez définir une chaîne d'hôte dans .env.",
|
|
11
11
|
"serverStart": "Démarrage du serveur",
|
package/package.json
CHANGED
package/example/index.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import {CLocal, TranslationLoader} from "opticore-translator";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import {ServerListenEventError} from "../src";
|
|
4
|
-
import process from "process";
|
|
5
|
-
|
|
6
|
-
console.log(TranslationLoader.t("rejectionPromise", 'en', { promise: "wd digital" }));
|
|
7
|
-
//console.log("__init is : ", ServerListenEventError.__init());
|
|
8
|
-
|
|
9
|
-
import { fileURLToPath } from 'url';
|
|
10
|
-
|
|
11
|
-
// Convertir l'URL du fichier en chemin de fichier
|
|
12
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
-
console.log("__filename is : ", __filename);
|
|
14
|
-
|
|
15
|
-
// Obtenir le répertoire du fichier
|
|
16
|
-
(() => {
|
|
17
|
-
const __dirname = path.dirname(__filename);
|
|
18
|
-
const server = ServerListenEventError;
|
|
19
|
-
server.hostPortUndefined("en");
|
|
20
|
-
})()
|