opticore-catch-exception-error 1.0.8 → 1.0.10

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 CHANGED
@@ -95,6 +95,9 @@ var CEventNameError = {
95
95
 
96
96
  // src/core/errors/base/stackTraceError.ts
97
97
  var StackTraceError = class extends Error {
98
+ name;
99
+ httpCode;
100
+ isOperational;
98
101
  /**
99
102
  *
100
103
  * @param props
@@ -215,12 +218,14 @@ var import_url = require("url");
215
218
  var translateCatchExceptionErrorLanguageLoader = () => {
216
219
  const __filename2 = (0, import_url.fileURLToPath)(importMetaUrl);
217
220
  const __dirname = import_path.default.dirname(__filename2);
218
- const translateMsgJsonFilePath = import_path.default.join(__dirname, "../../../", "utils", "translations");
221
+ const translateMsgJsonFilePath = import_path.default.join(__dirname, "../../../../", "dist", "utils", "translations");
219
222
  import_opticore_translator.TranslationLoader.loadTranslations(translateMsgJsonFilePath, import_opticore_env_access.getEnvVariable.defaultLocal);
220
223
  };
221
224
 
222
225
  // src/core/errors/events/serverListen.event.error.ts
223
226
  var ServerListenEventError = class {
227
+ static logger = new import_opticore_logger.LoggerCore();
228
+ static stackTrace;
224
229
  static __init() {
225
230
  translateCatchExceptionErrorLanguageLoader();
226
231
  return this;
@@ -730,7 +735,6 @@ var ServerListenEventError = class {
730
735
  return new StackTraceError(props, name, status12, true);
731
736
  }
732
737
  };
733
- ServerListenEventError.logger = new import_opticore_logger.LoggerCore();
734
738
  // Annotate the CommonJS export names for ESM import in node:
735
739
  0 && (module.exports = {
736
740
  CErrorName,
package/dist/index.js CHANGED
@@ -41,6 +41,9 @@ var CEventNameError = {
41
41
 
42
42
  // src/core/errors/base/stackTraceError.ts
43
43
  var StackTraceError = class extends Error {
44
+ name;
45
+ httpCode;
46
+ isOperational;
44
47
  /**
45
48
  *
46
49
  * @param props
@@ -158,16 +161,17 @@ import path from "path";
158
161
  import { TranslationLoader } from "opticore-translator";
159
162
  import { getEnvVariable } from "opticore-env-access";
160
163
  import { fileURLToPath } from "url";
161
- var import_meta = {};
162
164
  var translateCatchExceptionErrorLanguageLoader = () => {
163
- const __filename2 = fileURLToPath(import_meta.url);
165
+ const __filename2 = fileURLToPath(import.meta.url);
164
166
  const __dirname2 = path.dirname(__filename2);
165
- const translateMsgJsonFilePath = path.join(__dirname2, "../../../", "utils", "translations");
167
+ const translateMsgJsonFilePath = path.join(__dirname2, "../../../../", "dist", "utils", "translations");
166
168
  TranslationLoader.loadTranslations(translateMsgJsonFilePath, getEnvVariable.defaultLocal);
167
169
  };
168
170
 
169
171
  // src/core/errors/events/serverListen.event.error.ts
170
172
  var ServerListenEventError = class {
173
+ static logger = new LoggerCore();
174
+ static stackTrace;
171
175
  static __init() {
172
176
  translateCatchExceptionErrorLanguageLoader();
173
177
  return this;
@@ -677,7 +681,6 @@ var ServerListenEventError = class {
677
681
  return new StackTraceError(props, name, status12, true);
678
682
  }
679
683
  };
680
- ServerListenEventError.logger = new LoggerCore();
681
684
  export {
682
685
  CErrorName,
683
686
  CEvent,
@@ -0,0 +1,130 @@
1
+ {
2
+ "erBadDbError": "ER_BAD_DB_ERROR",
3
+ "erAccessDeniedError": "ER_ACCESS_DENIED_ERROR",
4
+ "erNotSupportedAuthMode": "ER_NOT_SUPPORTED_AUTH_MODE",
5
+ "eAiAgain": "EAI_AGAIN",
6
+ "dbConnection": "Database connection",
7
+ "dbConnectionClosed": "MySQL connection is closed",
8
+ "mysqlErrorCon": "MysqlError connection",
9
+ "mySQLError": "MysqlError",
10
+ "mySqlCloseConnection": "MySql close connection",
11
+ "dbConnexionSuccess": "The database connection was successful 🚀",
12
+ "mongoConnectionSuccess": "Connection to database is successfully.",
13
+ "connSuccess": "success connection",
14
+ "mongoDBConnectionChecker": "MongoDB Connection Checker",
15
+ "mongoConnection": "connection",
16
+ "mongoDBAuthentication": "authentication",
17
+ "mongoDBConnection": "MongoDB connection",
18
+ "mongoDBAuthenticationFailed": "failed",
19
+ "mongoDBUnableParsingUrl": "unable to parse",
20
+ "mongoDBConnectionUrl": "url",
21
+ "mongoDBServerSelection": "MongoServer selection error",
22
+ "mongoDBServer": "MongoServer",
23
+ "mongoDBConnectionError": "connection error",
24
+ "mongoDBError": "error",
25
+ "mongoDBAuthenticationError": "Authentication failed, be sure the credentials is correct.",
26
+ "postgresDBConnectionChecker": "PostgresDB Connection Checker",
27
+ "postgresConnection": "connection",
28
+ "postgresConnectionSuccess": "Connection to database is successfully.",
29
+ "postgresSuccessConn": "Postgres client Connection",
30
+ "postgresClosingConnSuccess": "Postgres client is close connection.",
31
+ "postgresEndClientRejection": "Postgres client end rejected",
32
+ "postgresClientError": "Postgres client error",
33
+ "postgresEndRejection": "End rejected",
34
+ "postgresConnError": "Postgres connection error",
35
+ "postgresException": "Exception",
36
+ "rsaKeyNotFound": "RSA key provided is not found.",
37
+ "encryptionWithPrivateKeyFailed": "Encryption With PrivateKey",
38
+ "encryptionFailed": "Encryption failed",
39
+ "verifyExistingKey": "Verify Existing Key",
40
+ "signatureRSAKeyFailed": "Signature verification failed.",
41
+ "signatureRSAKeysError": "Signature RSA Keys Error",
42
+ "errorDecryption": "Error decryption with private key",
43
+ "errorNameNotVerifyingRSAKey": "Error Verify RSA Key",
44
+ "decryptionWithPublicKeyFailed": "Decryption With PublicKey",
45
+ "decryptionFailed": "Decryption failed",
46
+ "verifyRSAKey": "Verify RSA Keys",
47
+ "verifyRSAKeyFailed": "Verify RSA Keys Failed",
48
+ "notVerifying": "Verification failed",
49
+ "mongoServerError": "MongoServerSelectionError: getaddrinfo EAI_AGAIN ({dbHost} is not allow to database connection)",
50
+ "dbUrlParsingError": "Unable to parse {dbHost}:{dbPort} with URL",
51
+ "errorDBHost": "A database host {host} does not allow connection. Please either set the host like this: {localhost} in your .env file",
52
+ "unknownDB": "Database {database} is unknown. Please try to use Database CLI to create your database, or do it manually in your Database Management System",
53
+ "accessDeniedToDBCon": "Access denied for user {user}. Database credentials in .env file are User: {user} and Password: {password}. '{user}''{password}'@'localhost'. Try to set user and password in .env file",
54
+ "badFormat": "Unsupported YAML line format",
55
+ "parsingFailed": "YAML Parsing failed",
56
+ "unsupportedFormat": "Unsupported YAML format",
57
+ "readingError": "Error reading YAML file",
58
+ "invalidRequest": "Invalid request",
59
+ "moduleNotLoaded": "The following module paths are not loaded: {notLoadedPaths}",
60
+ "serverRouteNotExist": "This route : http://{host}:{port} do not exist.",
61
+ "webServer": "Web server",
62
+ "listening": "listening",
63
+ "webHost": "host",
64
+ "badHost": "bad host",
65
+ "hostNotFound": "not found",
66
+ "errorHostUrl": "The host and port are not define, please define them in .env",
67
+ "badPort": "bad port",
68
+ "errorPort": "The port is not correct. Please define a right port with number port.",
69
+ "errorHost": "The host can't be empty or blank. Please define a string host in .env",
70
+ "serverStart": "Server start",
71
+ "serverStartError": "Server start error",
72
+ "processExitCode": "Process will exit with code: {code}",
73
+ "beforeExit": "BeforeExit",
74
+ "processBeforeExit": "process before exit",
75
+ "childProcessDiscon": "Child process disconnected",
76
+ "processDiscon": "process disconnected",
77
+ "disconnected": "Disconnected",
78
+ "completed": "completed",
79
+ "finishingProcessWell": "The process finished as expected and everything is ok",
80
+ "serverStopped": "[OK] The server shutting down",
81
+ "somethingWentWrong": "Something went wrong",
82
+ "genErrors": "General Errors",
83
+ "exited": "Exited",
84
+ "incorrectCmd": "Incorrect using of shell commands",
85
+ "misuseShell": "Misuse of shell builtins",
86
+ "cmdNotExecutable": "The command is found but is not executable (e.g., trying to execute a directory)",
87
+ "cmdNotFound": "Command not found",
88
+ "cmdNotFoundInSystemPath": "The command was not found in the system's PATH or is misspelled",
89
+ "argInvalid": "Invalid argument",
90
+ "scriptEndedManuallyByCtrlC": "Indicates that the script was manually terminated by the user using the Control-C (SIGINT) signal",
91
+ "processEndedBySIGKILL": "Indicates that the process was terminated by a SIGKILL signal, possibly due to an out-of-memory situation",
92
+ "scriptEnded": "Script terminated",
93
+ "accessProcessIllegally": "Indicates that the process accessed an illegal memory address (segfault)",
94
+ "defaultSegment": "Segmentation fault",
95
+ "processReceivedSigtermSignal": "Indicates that the process received a SIGTERM signal to terminate",
96
+ "processReceived": "process received a SIGTERM",
97
+ "exitCode": "An exit code that is outside the allowable range (0-255 for Unix-like systems)",
98
+ "outRange": "out of range",
99
+ "errorOccurring": "Error is occurring",
100
+ "errors": "errors",
101
+ "promiseRejectionHandled": "Promise rejection is handled at : {promise}",
102
+ "rejectionPromise": "rejection promise",
103
+ "uncaughtExceptionHandled": "uncaught exception handled",
104
+ "unhandledRejectionAtPromise": "Unhandled Rejection at: Promise {promise} -- reason {reason}",
105
+ "unhandledRejection": "Unhandled rejection",
106
+ "processGotMsg": "process got message {message}",
107
+ "msgException": "message exception",
108
+ "promiseReason": "{promise} -- {reason}",
109
+ "multipleResolvesDetected": "Multiple resolves detected : {type}",
110
+ "serverWebStopped": "The Web server has been stopped !",
111
+ "okSuccess": "[ OK ] Success",
112
+ "processPIDReceivedSignal": "Process ${process.pid} received a SIGTERM signal : {signal}",
113
+ "serverClosed": "Server is closed",
114
+ "allProcessStopped": "All processes are stopped",
115
+ "serverDroppedCon": "The server dropped new connections",
116
+ "serverMaxCon": "Server maxConnection",
117
+ "internalServerError": "Internal Server Error",
118
+ "resStatusNotFunc": "res.status is not a function",
119
+ "respndNotFunc": "response not Function",
120
+ "expressErrorHandlingMiddleware": "Express error-handling middleware",
121
+ "expressError": "Express error",
122
+ "serverRunning": "The server is running in",
123
+ "okServerListening": "[OK] Web server listening",
124
+ "webServerUseNodeVersion": "The Web server is using Node.js version",
125
+ "startupTime": "Startup time:",
126
+ "totalMemory": "Resident Set Size - total memory allocated for the process execution :",
127
+ "memoryUsedDuringExecution": "Actual memory used during the execution :",
128
+ "memoryUsedByUser": "Memory usage by user :",
129
+ "memoryUsedBySystem": "Memory usage by system :"
130
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "erBadDbError": "ER_BAD_DB_ERROR",
3
+ "erAccessDeniedError": "ER_ACCESS_DENIED_ERROR",
4
+ "erNotSupportedAuthMode": "ER_NOT_SUPPORTED_AUTH_MODE",
5
+ "eAiAgain": "EAI_AGAIN",
6
+ "dbConnection": "DataBase connection",
7
+ "dbConnectionClosed": "MySQL connection is closed",
8
+ "mysqlErrorCon": "MysqlError connection",
9
+ "mySQLError": "MysqlError",
10
+ "mySqlCloseConnection": "MySql close connection",
11
+ "mongoConnectionSuccess": "Connection to database is successfully.",
12
+ "mongoDBConnectionChecker": "MongoDB Connection Checker",
13
+ "mongoConnection": "connection",
14
+ "mongoDBAuthentication": "authentication",
15
+ "mongoDBConnection": "MongoDB connection",
16
+ "mongoDBAuthenticationFailed": "failed",
17
+ "mongoDBUnableParsingUrl": "unable to parse",
18
+ "mongoDBConnectionUrl": "url",
19
+ "mongoDBServerSelection": "MongoServer selection error",
20
+ "mongoDBServer": "MongoServer",
21
+ "mongoDBConnectionError": "connection error",
22
+ "mongoDBError": "error",
23
+ "mongoDBAuthenticationError": "Authentication failed, be sure the credentials is correct.",
24
+ "postgresDBConnectionChecker": "PostgresDB Connection Checker",
25
+ "postgresConnection": "connection",
26
+ "postgresConnectionSuccess": "Connection to database is successfully.",
27
+ "postgresSuccessConn": "Postgres client Connection",
28
+ "postgresClosingConnSuccess": "Postgres client is close connection.",
29
+ "postgresEndClientRejection": "Postgres client end rejected",
30
+ "postgresClientError": "Postgres client error",
31
+ "postgresEndRejection": "End rejected",
32
+ "postgresConnError": "Postgres connection error",
33
+ "postgresException": "Exception",
34
+ "rsaKeyNotFound": "RSA key provided is not found.",
35
+ "encryptionWithPrivateKeyFailed": "Encryption With PrivateKey",
36
+ "encryptionFailed": "Encryption failed",
37
+ "verifyExistingKey": "Verify Existing Key",
38
+ "signatureRSAKeyFailed": "Signature verification failed.",
39
+ "signatureRSAKeysError": "Signature RSA Keys Error",
40
+ "errorDecryption": "Error decryption with private key",
41
+ "errorNameNotVerifyingRSAKey": "Error Verify RSA Key",
42
+ "decryptionWithPublicKeyFailed": "Decryption With PublicKey",
43
+ "decryptionFailed": "Decryption failed",
44
+ "verifyRSAKey": "Verify RSA Keys",
45
+ "verifyRSAKeyFailed": "Verify RSA Keys Failed",
46
+ "notVerifying": "Verification failed",
47
+ "mongoServerError": "MongoServerSelectionError: getaddrinfo EAI_AGAIN ({dbHost} is not allow to database connection)",
48
+ "dbUrlParsingError": "Unable to parse ${dbHost}:${dbPort} with URL"
49
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opticore-catch-exception-error",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "opticore catch exception error",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
package/tsconfig.json CHANGED
@@ -4,9 +4,9 @@
4
4
  "noImplicitAny": true,
5
5
  "esModuleInterop": true,
6
6
  "strictNullChecks": true,
7
- "module": "commonjs",
7
+ "module": "ES2022",
8
8
  "pretty": true,
9
- "target": "es2017",
9
+ "target": "es2022",
10
10
  "moduleResolution": "node",
11
11
  "declaration": true,
12
12
  "isolatedModules": true,