opticore-webapp 1.0.0 → 1.0.2
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 +311 -419
- package/dist/index.js +321 -429
- package/package.json +2 -2
- package/src/core/events/errors/serverListen.event.error.ts +157 -243
- package/src/core/events/requestCalls.event.ts +0 -3
- package/src/core/handlers/errors/stackTraceEvalError.ts +3 -3
- package/src/core/handlers/errors/stackTraceGeneralError.ts +3 -3
- package/src/core/handlers/errors/stackTraceOpenSSLError.ts +3 -3
- package/src/core/handlers/errors/stackTraceRangeError.ts +3 -3
- package/src/core/handlers/errors/stackTraceReferenceError.ts +3 -3
- package/src/core/handlers/errors/stackTraceSyntaxError.ts +3 -3
- package/src/core/handlers/errors/stackTraceSystemError.ts +3 -3
- package/src/core/handlers/errors/stackTraceTypeError.ts +3 -3
- package/src/core/handlers/errors/stackTraceURIError.ts +3 -3
- package/src/core/handlers/eventProcess.handler.ts +1 -1
- package/tsup.config.ts +1 -1
package/dist/index.cjs
CHANGED
|
@@ -146,181 +146,17 @@ var StackTraceError = class extends Error {
|
|
|
146
146
|
var import_express = __toESM(require("express"), 1);
|
|
147
147
|
var import_node_process = __toESM(require("process"), 1);
|
|
148
148
|
var import_node_events = __toESM(require("events"), 1);
|
|
149
|
-
var import_serverListen_event = require("@/errors/serverListen.event.error");
|
|
150
|
-
function eventProcessHandler() {
|
|
151
|
-
const errorEmitter = new import_node_events.default();
|
|
152
|
-
const app = (0, import_express.default)();
|
|
153
|
-
errorEmitter.on(CEventNameError.error, (error) => {
|
|
154
|
-
import_serverListen_event.ServerListenEventError.listenerError(error);
|
|
155
|
-
});
|
|
156
|
-
import_node_process.default.on(CEvent.beforeExit, (code) => {
|
|
157
|
-
setTimeout(() => {
|
|
158
|
-
import_serverListen_event.ServerListenEventError.processBeforeExit(code);
|
|
159
|
-
}, 100);
|
|
160
|
-
});
|
|
161
|
-
import_node_process.default.on(CEvent.disconnect, () => {
|
|
162
|
-
import_serverListen_event.ServerListenEventError.processDisconnected();
|
|
163
|
-
});
|
|
164
|
-
import_node_process.default.on(CEvent.exit, (code) => {
|
|
165
|
-
import_serverListen_event.ServerListenEventError.exited(code);
|
|
166
|
-
});
|
|
167
|
-
import_node_process.default.on(CEvent.rejectionHandled, (promise) => {
|
|
168
|
-
import_serverListen_event.ServerListenEventError.promiseRejectionHandled(promise);
|
|
169
|
-
});
|
|
170
|
-
import_node_process.default.on(CEvent.uncaughtException, (error) => {
|
|
171
|
-
import_serverListen_event.ServerListenEventError.uncaughtException(error);
|
|
172
|
-
});
|
|
173
|
-
import_node_process.default.on(CEvent.uncaughtExceptionMonitor, (error) => {
|
|
174
|
-
import_serverListen_event.ServerListenEventError.uncaughtExceptionMonitor(error);
|
|
175
|
-
});
|
|
176
|
-
import_node_process.default.on(CEvent.unhandledRejection, (reason, promise) => {
|
|
177
|
-
import_serverListen_event.ServerListenEventError.unhandledRejection(reason, promise);
|
|
178
|
-
});
|
|
179
|
-
import_node_process.default.on(CEvent.warning, (warning) => {
|
|
180
|
-
import_serverListen_event.ServerListenEventError.warning(warning);
|
|
181
|
-
});
|
|
182
|
-
import_node_process.default.on(CEvent.message, (message) => {
|
|
183
|
-
import_serverListen_event.ServerListenEventError.message(message);
|
|
184
|
-
});
|
|
185
|
-
import_node_process.default.on(CEvent.multipleResolves, (type, promise, reason) => {
|
|
186
|
-
import_serverListen_event.ServerListenEventError.multipleResolves(type, promise, reason);
|
|
187
|
-
});
|
|
188
|
-
import_node_process.default.on(CEvent.sigint, () => {
|
|
189
|
-
import_serverListen_event.ServerListenEventError.processInterrupted();
|
|
190
|
-
});
|
|
191
|
-
import_node_process.default.on(CEvent.sigterm, (signal) => {
|
|
192
|
-
import_serverListen_event.ServerListenEventError.sigtermSignalReceived(signal);
|
|
193
|
-
});
|
|
194
|
-
app.use((err, req, res, next) => {
|
|
195
|
-
import_serverListen_event.ServerListenEventError.expressErrorHandlingMiddleware(errorEmitter, err, req, res, next);
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// src/core/events/requestCalls.event.ts
|
|
200
|
-
var import_ansi_colors = __toESM(require("ansi-colors"), 1);
|
|
201
|
-
var import_opticore_logger = require("opticore-logger");
|
|
202
|
-
function requestCallsEvent(req, res, host, port, loadingTime) {
|
|
203
|
-
const logger = new import_opticore_logger.LoggerCore();
|
|
204
|
-
const currentDatePath = `Request called`;
|
|
205
|
-
if (req.originalUrl === "undefined") {
|
|
206
|
-
console.log(`[ ${import_ansi_colors.default.red(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors.default.bgRed(`${import_ansi_colors.default.white(` Not found `)}`)} [ Host ] http://${host}:${port} - [ Route ] The route do not exist. - [ Status ] ${import_ansi_colors.default.red(`${import_ansi_colors.default.white(` 404 `)}`)}`);
|
|
207
|
-
logger.error("The route do not exist.");
|
|
208
|
-
} else {
|
|
209
|
-
switch (res.statusCode) {
|
|
210
|
-
case 200:
|
|
211
|
-
switch (req.method) {
|
|
212
|
-
case "POST":
|
|
213
|
-
console.log(`[ ${import_ansi_colors.default.cyan(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors.default.bgGreen(`${import_ansi_colors.default.white(` Success `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${import_ansi_colors.default.bgCyan(`${import_ansi_colors.default.white(` 200 `)}`)}`);
|
|
214
|
-
logger.info(`[ ${import_ansi_colors.default.cyan(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors.default.bgGreen(`${import_ansi_colors.default.white(` Success `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${import_ansi_colors.default.bgCyan(`${import_ansi_colors.default.white(` 200 `)}`)}`);
|
|
215
|
-
break;
|
|
216
|
-
case "GET":
|
|
217
|
-
case "PUT":
|
|
218
|
-
console.log(`[ ${import_ansi_colors.default.cyan(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors.default.bgGreen(`${import_ansi_colors.default.white(` Success `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${import_ansi_colors.default.bgCyan(`${import_ansi_colors.default.white(` 200 `)}`)}`);
|
|
219
|
-
logger.info(`[ ${import_ansi_colors.default.cyan(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors.default.bgGreen(`${import_ansi_colors.default.white(` Success `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${import_ansi_colors.default.bgCyan(`${import_ansi_colors.default.white(` 200 `)}`)}`);
|
|
220
|
-
break;
|
|
221
|
-
case "DELETE":
|
|
222
|
-
console.log(`[ ${import_ansi_colors.default.cyan(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors.default.bgGreen(`${import_ansi_colors.default.white(` Success `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${import_ansi_colors.default.bgCyan(`${import_ansi_colors.default.white(` 200 `)}`)}`);
|
|
223
|
-
logger.info(`[ ${import_ansi_colors.default.cyan(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors.default.bgGreen(`${import_ansi_colors.default.white(` Success `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${import_ansi_colors.default.bgCyan(`${import_ansi_colors.default.white(` 200 `)}`)}`);
|
|
224
|
-
break;
|
|
225
|
-
}
|
|
226
|
-
break;
|
|
227
|
-
case 404:
|
|
228
|
-
switch (req.method) {
|
|
229
|
-
case "POST":
|
|
230
|
-
console.log(`[ ${import_ansi_colors.default.red(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors.default.bgRed(`${import_ansi_colors.default.white(` Not found `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${import_ansi_colors.default.red(`${import_ansi_colors.default.white(` 404 `)}`)}`);
|
|
231
|
-
break;
|
|
232
|
-
case "GET":
|
|
233
|
-
console.log(`[ ${import_ansi_colors.default.red(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors.default.bgRed(`${import_ansi_colors.default.white(` Not found `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${import_ansi_colors.default.red(`${import_ansi_colors.default.bold(` 404 `)}`)}`);
|
|
234
|
-
break;
|
|
235
|
-
case "PUT":
|
|
236
|
-
console.log(`[ ${import_ansi_colors.default.red(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors.default.bgRed(`${import_ansi_colors.default.white(` Not found `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${import_ansi_colors.default.red(`${import_ansi_colors.default.bold(` 404 `)}`)}`);
|
|
237
|
-
break;
|
|
238
|
-
case "DELETE":
|
|
239
|
-
console.log(`[ ${import_ansi_colors.default.red(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors.default.bgRed(`${import_ansi_colors.default.white(` Not found `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${import_ansi_colors.default.red(`${import_ansi_colors.default.bold(` 404 `)}`)}`);
|
|
240
|
-
break;
|
|
241
|
-
}
|
|
242
|
-
break;
|
|
243
|
-
case 401:
|
|
244
|
-
switch (req.method) {
|
|
245
|
-
case "POST":
|
|
246
|
-
console.log(`[ ${import_ansi_colors.default.yellowBright(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors.default.bgYellowBright(`${import_ansi_colors.default.white(` Unauthorized `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${import_ansi_colors.default.bgYellow(`${import_ansi_colors.default.bold(` 401 `)}`)}`);
|
|
247
|
-
break;
|
|
248
|
-
case "GET":
|
|
249
|
-
console.log(`[ ${import_ansi_colors.default.yellowBright(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors.default.bgYellowBright(`${import_ansi_colors.default.white(` Unauthorized `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${import_ansi_colors.default.bgYellow(`${import_ansi_colors.default.bold(` 401 `)}`)}`);
|
|
250
|
-
break;
|
|
251
|
-
case "PUT":
|
|
252
|
-
console.log(`[ ${import_ansi_colors.default.yellowBright(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors.default.bgYellowBright(`${import_ansi_colors.default.white(` Unauthorized `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${import_ansi_colors.default.bgYellow(`${import_ansi_colors.default.bold(` 401 `)}`)}`);
|
|
253
|
-
break;
|
|
254
|
-
case "DELETE":
|
|
255
|
-
console.log(`[ ${import_ansi_colors.default.yellowBright(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors.default.bgYellowBright(`${import_ansi_colors.default.white(` Unauthorized `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${import_ansi_colors.default.bgYellow(`${import_ansi_colors.default.bold(` 401 `)}`)}`);
|
|
256
|
-
break;
|
|
257
|
-
}
|
|
258
|
-
break;
|
|
259
|
-
case 500:
|
|
260
|
-
switch (req.method) {
|
|
261
|
-
case "POST":
|
|
262
|
-
console.log(`[ ${import_ansi_colors.default.red(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors.default.bgRed(`${import_ansi_colors.default.white(` Server error `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${import_ansi_colors.default.red(`${import_ansi_colors.default.bold(` 500 `)}`)}`);
|
|
263
|
-
break;
|
|
264
|
-
case "GET":
|
|
265
|
-
console.log(`[ ${import_ansi_colors.default.red(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors.default.bgRed(`${import_ansi_colors.default.white(` Server error `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${import_ansi_colors.default.red(`${import_ansi_colors.default.bold(` 500 `)}`)}`);
|
|
266
|
-
break;
|
|
267
|
-
case "PUT":
|
|
268
|
-
console.log(`[ ${import_ansi_colors.default.red(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors.default.bgRed(`${import_ansi_colors.default.white(` Server error `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${import_ansi_colors.default.red(`${import_ansi_colors.default.bold(` 500 `)}`)}`);
|
|
269
|
-
break;
|
|
270
|
-
case "DELETE":
|
|
271
|
-
console.log(`[ ${import_ansi_colors.default.red(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors.default.bgRed(`${import_ansi_colors.default.white(` Server error `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${import_ansi_colors.default.red(`${import_ansi_colors.default.bold(` 500 `)}`)}`);
|
|
272
|
-
break;
|
|
273
|
-
}
|
|
274
|
-
break;
|
|
275
|
-
default:
|
|
276
|
-
console.log(`[ ${import_ansi_colors.default.blueBright(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors.default.blueBright(` ${res.statusMessage} `)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${import_ansi_colors.default.blueBright(` ${res.req.socket._httpMessage.statusCode} `)}`);
|
|
277
|
-
break;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
// src/domains/constants/eventNameError.constant.ts
|
|
283
|
-
var CEventNameError = {
|
|
284
|
-
error: "error",
|
|
285
|
-
listening: "listening",
|
|
286
|
-
close: "close",
|
|
287
|
-
connection: "connection",
|
|
288
|
-
drop: "drop",
|
|
289
|
-
request: "request"
|
|
290
|
-
};
|
|
291
149
|
|
|
292
150
|
// src/core/events/errors/serverListen.event.error.ts
|
|
293
151
|
var import_process = __toESM(require("process"), 1);
|
|
294
|
-
var import_ansi_colors4 = __toESM(require("ansi-colors"), 1);
|
|
295
|
-
var import_chalk = __toESM(require("chalk"), 1);
|
|
296
|
-
|
|
297
|
-
// src/core/utils/logMessage.utils.ts
|
|
298
152
|
var import_ansi_colors2 = __toESM(require("ansi-colors"), 1);
|
|
153
|
+
var import_chalk = __toESM(require("chalk"), 1);
|
|
299
154
|
|
|
300
155
|
// src/core/utils/dateTimeFormatted.utils.ts
|
|
301
156
|
var dateTimeFormattedUtils = `${(/* @__PURE__ */ new Date()).getMonth()}-${(/* @__PURE__ */ new Date()).getDate()}-${(/* @__PURE__ */ new Date()).getFullYear()} ${(/* @__PURE__ */ new Date()).getHours()}:${(/* @__PURE__ */ new Date()).getMinutes()}:${(/* @__PURE__ */ new Date()).getSeconds()}`;
|
|
302
157
|
|
|
303
|
-
// src/core/utils/logMessage.utils.ts
|
|
304
|
-
var LogMessageUtils = class {
|
|
305
|
-
static success(title, action, contentAction) {
|
|
306
|
-
console.log(`${import_ansi_colors2.default.green(`\u2714`)} ${import_ansi_colors2.default.bgGreen(` ${import_ansi_colors2.default.bold(`${import_ansi_colors2.default.white(`${title}`)}`)} `)} ${dateTimeFormattedUtils} | ${import_ansi_colors2.default.bgGreen(`${import_ansi_colors2.default.white(` Success `)}`)} [ ${action} ] ${contentAction} - [ Status ] ${import_ansi_colors2.default.bgGreen(`${import_ansi_colors2.default.white(` 200 `)}`)}`);
|
|
307
|
-
}
|
|
308
|
-
static warning(title, action, contentAction) {
|
|
309
|
-
console.warn(`${import_ansi_colors2.default.yellow(`\u26A0\uFE0F`)} ${import_ansi_colors2.default.bgYellow(` ${import_ansi_colors2.default.bold(`${import_ansi_colors2.default.white(`${title}`)}`)} `)} ${dateTimeFormattedUtils} | ${import_ansi_colors2.default.bgYellow(`${import_ansi_colors2.default.white(` Warning `)}`)} ${contentAction}`);
|
|
310
|
-
}
|
|
311
|
-
static info(title, action, contentAction) {
|
|
312
|
-
console.info(`${import_ansi_colors2.default.cyan(`\u24D8`)} ${import_ansi_colors2.default.bgCyan(` ${import_ansi_colors2.default.bold(`${import_ansi_colors2.default.white(`${title}`)}`)} `)} ${dateTimeFormattedUtils} | ${import_ansi_colors2.default.bgCyan(`${import_ansi_colors2.default.white(` Info `)}`)} ${contentAction}`);
|
|
313
|
-
}
|
|
314
|
-
static error(title, errorType, stackTrace, messageContent, httpCodeValue) {
|
|
315
|
-
console.error(`${import_ansi_colors2.default.red(`\u2718`)} ${import_ansi_colors2.default.bgRed(` ${import_ansi_colors2.default.bold(`${import_ansi_colors2.default.white(`${title}`)}`)} `)} | ${dateTimeFormattedUtils} | [ ${import_ansi_colors2.default.red(`${import_ansi_colors2.default.bold(` ${errorType} `)}`)} ] | [ ${import_ansi_colors2.default.bold(`stack trace`)} ] ${import_ansi_colors2.default.red(`${stackTrace}`)} - ${import_ansi_colors2.default.red(`${messageContent}`)} - [ ${import_ansi_colors2.default.red(`${import_ansi_colors2.default.bold(` HttpCode `)}`)} ] ${import_ansi_colors2.default.red(`${import_ansi_colors2.default.bold(` ${httpCodeValue} `)}`)} `);
|
|
316
|
-
}
|
|
317
|
-
static requestError(title, errorName, errorMessage, errorCode) {
|
|
318
|
-
console.error(`[ ${import_ansi_colors2.default.red(`${title}`)} ] ${dateTimeFormattedUtils} | ${import_ansi_colors2.default.bgRed(`${import_ansi_colors2.default.white(` ERROR `)}`)} ${import_ansi_colors2.default.red(`[ ${errorName} ]`)} ${import_ansi_colors2.default.red(`${errorMessage}`)} - [ Status ] ${import_ansi_colors2.default.bgRed(`${import_ansi_colors2.default.white(` ${errorCode} `)}`)}`);
|
|
319
|
-
}
|
|
320
|
-
};
|
|
321
|
-
|
|
322
158
|
// src/application/exceptions/messages.exception.ts
|
|
323
|
-
var
|
|
159
|
+
var import_ansi_colors = __toESM(require("ansi-colors"), 1);
|
|
324
160
|
var messageException = {
|
|
325
161
|
dbConnection: "DataBase connection",
|
|
326
162
|
dbConnectionClosed: "MySQL connection is closed",
|
|
@@ -384,388 +220,297 @@ var messageException = {
|
|
|
384
220
|
errorHost: "The host can't be empty or blank. Please define a string host in .env",
|
|
385
221
|
accessDeniedToDBCon: (user, password) => `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`,
|
|
386
222
|
unknownDB: (database) => `Database ${database} is unknown. Please try to use Database CLI to create your database, or do it manually in your Database Management System`,
|
|
387
|
-
errorDBHost: (host) => `A database host ${host} does not allow connection. Please either set the host like this: ${
|
|
223
|
+
errorDBHost: (host) => `A database host ${host} does not allow connection. Please either set the host like this: ${import_ansi_colors.default.bgRed(`${import_ansi_colors.default.white(`localhost`)}`)} in your .env file`
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
// src/domains/constants/eventNameError.constant.ts
|
|
227
|
+
var CEventNameError = {
|
|
228
|
+
error: "error",
|
|
229
|
+
listening: "listening",
|
|
230
|
+
close: "close",
|
|
231
|
+
connection: "connection",
|
|
232
|
+
drop: "drop",
|
|
233
|
+
request: "request"
|
|
388
234
|
};
|
|
389
235
|
|
|
390
236
|
// src/core/events/errors/serverListen.event.error.ts
|
|
391
|
-
var
|
|
237
|
+
var import_opticore_logger = require("opticore-logger");
|
|
238
|
+
var ServerListenEventError = class {
|
|
239
|
+
/**
|
|
240
|
+
*
|
|
241
|
+
*/
|
|
392
242
|
static hostPortUndefined() {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
messageException.webServer,
|
|
396
|
-
messageException.badHost,
|
|
397
|
-
stackTrace.stack,
|
|
398
|
-
messageException.errorHostUrl,
|
|
399
|
-
400 /* BAD_REQUEST */
|
|
400
|
-
);
|
|
243
|
+
this.stackTrace = this.traceError(messageException.errorHostUrl, messageException.listening, 400 /* BAD_REQUEST */);
|
|
244
|
+
this.logger.error(this.stackTrace.message, messageException.webServer, messageException.badHost, this.stackTrace.stack, 400 /* BAD_REQUEST */);
|
|
401
245
|
import_process.default.exit();
|
|
402
246
|
}
|
|
247
|
+
/**
|
|
248
|
+
*
|
|
249
|
+
*/
|
|
403
250
|
static hostUndefined() {
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
messageException.webServer,
|
|
407
|
-
messageException.badHost,
|
|
408
|
-
stackTrace.stack,
|
|
409
|
-
messageException.errorHost,
|
|
410
|
-
400 /* BAD_REQUEST */
|
|
411
|
-
);
|
|
251
|
+
this.stackTrace = this.traceError(messageException.badHost, messageException.listening, 400 /* BAD_REQUEST */);
|
|
252
|
+
this.logger.error(this.stackTrace.message, messageException.webServer, messageException.badHost, this.stackTrace.stack, 400 /* BAD_REQUEST */);
|
|
412
253
|
import_process.default.exit();
|
|
413
254
|
}
|
|
255
|
+
/**
|
|
256
|
+
*
|
|
257
|
+
*/
|
|
414
258
|
static portUndefined() {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
messageException.webServer,
|
|
418
|
-
messageException.badPort,
|
|
419
|
-
stackTrace.stack,
|
|
420
|
-
messageException.errorPort,
|
|
421
|
-
400 /* BAD_REQUEST */
|
|
422
|
-
);
|
|
259
|
+
this.stackTrace = this.traceError(messageException.badPort, messageException.listening, 400 /* BAD_REQUEST */);
|
|
260
|
+
this.logger.error(this.stackTrace.message, messageException.webServer, messageException.badHost, this.stackTrace.stack, 400 /* BAD_REQUEST */);
|
|
423
261
|
import_process.default.exit();
|
|
424
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
*
|
|
265
|
+
* @param err
|
|
266
|
+
*/
|
|
425
267
|
static onEventError(err) {
|
|
426
|
-
|
|
427
|
-
"Server start error",
|
|
428
|
-
"Error",
|
|
429
|
-
err.stack,
|
|
430
|
-
err.message,
|
|
431
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
432
|
-
);
|
|
268
|
+
this.logger.error(err.message, "Server start error", "Error", err.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
433
269
|
}
|
|
270
|
+
/**
|
|
271
|
+
*
|
|
272
|
+
* @param error
|
|
273
|
+
*/
|
|
434
274
|
static listenerError(error) {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
error.name,
|
|
438
|
-
400 /* BAD_REQUEST */
|
|
439
|
-
);
|
|
440
|
-
LogMessageUtils.error(
|
|
441
|
-
"Event error",
|
|
442
|
-
"Error",
|
|
443
|
-
error.stack,
|
|
444
|
-
stackTrace.message,
|
|
445
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
446
|
-
);
|
|
275
|
+
this.stackTrace = this.traceError(error.message, error.name, 400 /* BAD_REQUEST */);
|
|
276
|
+
this.logger.error(this.stackTrace.message, "Event error", "Error", error.stack, 400 /* BAD_REQUEST */);
|
|
447
277
|
}
|
|
278
|
+
/**
|
|
279
|
+
*
|
|
280
|
+
* @param code
|
|
281
|
+
*/
|
|
448
282
|
static processBeforeExit(code) {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
"BeforeExit",
|
|
452
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
453
|
-
);
|
|
454
|
-
LogMessageUtils.error(
|
|
455
|
-
"BeforeExit",
|
|
456
|
-
"process before exit",
|
|
457
|
-
stackTrace.stack,
|
|
458
|
-
`Process will exit with code: ${code}`,
|
|
459
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
460
|
-
);
|
|
283
|
+
this.stackTrace = this.traceError(`Process will exit with code: ${code}`, "BeforeExit", 503 /* SERVICE_UNAVAILABLE */);
|
|
284
|
+
this.logger.error(this.stackTrace.message, "BeforeExit", "process before exit", this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
461
285
|
import_process.default.exit(code);
|
|
462
286
|
}
|
|
287
|
+
/**
|
|
288
|
+
*
|
|
289
|
+
*/
|
|
463
290
|
static processDisconnected() {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
"process disconnected",
|
|
467
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
468
|
-
);
|
|
469
|
-
LogMessageUtils.error(
|
|
470
|
-
"Disconnected",
|
|
471
|
-
"process disconnected",
|
|
472
|
-
stackTrace.stack,
|
|
473
|
-
"Child process disconnected",
|
|
474
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
475
|
-
);
|
|
291
|
+
this.stackTrace = this.traceError("Child process disconnected", "process disconnected", 503 /* SERVICE_UNAVAILABLE */);
|
|
292
|
+
this.logger.error(this.stackTrace.message, "Disconnected", "process disconnected", this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
476
293
|
import_process.default.exit();
|
|
477
294
|
}
|
|
295
|
+
/**
|
|
296
|
+
*
|
|
297
|
+
* @param code
|
|
298
|
+
*/
|
|
478
299
|
static exited(code) {
|
|
479
300
|
switch (code) {
|
|
480
301
|
case 0:
|
|
481
|
-
|
|
482
|
-
"Exited",
|
|
483
|
-
"completed",
|
|
484
|
-
"The process finished as expected and everything is ok"
|
|
485
|
-
);
|
|
302
|
+
this.logger.success("completed", "The process finished as expected and everything is ok");
|
|
486
303
|
console.log("");
|
|
487
304
|
const paddingLength = 35;
|
|
488
305
|
const msg0 = " ".padEnd(paddingLength, " ");
|
|
489
306
|
console.log(import_chalk.default.bgGreen.white(msg0.padEnd(paddingLength, " ")));
|
|
490
|
-
console.log(`${
|
|
307
|
+
console.log(`${import_ansi_colors2.default.bgGreen(` [OK] The server shutting down `)}`);
|
|
491
308
|
console.log(import_chalk.default.bgGreen.white(msg0.padEnd(paddingLength, " ")));
|
|
492
309
|
break;
|
|
493
310
|
case 1:
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
"General Errors",
|
|
497
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
498
|
-
);
|
|
499
|
-
LogMessageUtils.error(
|
|
500
|
-
"Exited",
|
|
501
|
-
"General Errors",
|
|
502
|
-
gnleStackTrace.stack,
|
|
503
|
-
"Something went wrong",
|
|
504
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
505
|
-
);
|
|
311
|
+
this.stackTrace = this.traceError("Something went wrong", "General Errors", 503 /* SERVICE_UNAVAILABLE */);
|
|
312
|
+
this.logger.error(this.stackTrace.message, "Exited", "General Errors", this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
506
313
|
break;
|
|
507
314
|
case 2:
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
"Misuse of shell builtins",
|
|
511
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
512
|
-
);
|
|
513
|
-
LogMessageUtils.error(
|
|
514
|
-
"Exited",
|
|
515
|
-
incrCmdStackTrace.name,
|
|
516
|
-
incrCmdStackTrace.stack,
|
|
517
|
-
"Incorrect using of shell commands",
|
|
518
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
519
|
-
);
|
|
315
|
+
this.stackTrace = this.traceError("Incorrect using of shell commands", "Misuse of shell builtins", 503 /* SERVICE_UNAVAILABLE */);
|
|
316
|
+
this.logger.error(this.stackTrace.message, "Exited", "Incorrect using of shell commands", this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
520
317
|
break;
|
|
521
318
|
case 126:
|
|
522
|
-
|
|
319
|
+
this.stackTrace = this.traceError(
|
|
523
320
|
"Incorrect using of shell commands",
|
|
524
|
-
"Misuse of shell builtins",
|
|
525
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
526
|
-
);
|
|
527
|
-
LogMessageUtils.error(
|
|
528
|
-
"Exited",
|
|
529
|
-
`command invoked`,
|
|
530
|
-
notExeCmdStackTrace.stack,
|
|
531
321
|
"The command is found but is not executable (e.g., trying to execute a directory)",
|
|
532
322
|
503 /* SERVICE_UNAVAILABLE */
|
|
533
323
|
);
|
|
324
|
+
this.logger.error(this.stackTrace.message, "Exited", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
534
325
|
break;
|
|
535
326
|
case 127:
|
|
536
|
-
|
|
537
|
-
"The command was not found in the system's PATH or is misspelled",
|
|
538
|
-
"Exited",
|
|
539
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
540
|
-
);
|
|
541
|
-
LogMessageUtils.error(
|
|
542
|
-
"Exited",
|
|
327
|
+
this.stackTrace = this.traceError(
|
|
543
328
|
"Command not found",
|
|
544
|
-
cmdNotFoundStackTrace.stack,
|
|
545
329
|
"The command was not found in the system's PATH or is misspelled",
|
|
546
330
|
503 /* SERVICE_UNAVAILABLE */
|
|
547
331
|
);
|
|
332
|
+
this.logger.error(this.stackTrace.message, "Exited", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
548
333
|
break;
|
|
549
334
|
case 128:
|
|
550
|
-
|
|
335
|
+
this.stackTrace = this.traceError(
|
|
551
336
|
"The command was not found in the system's PATH or is misspelled",
|
|
552
|
-
"Exited",
|
|
553
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
554
|
-
);
|
|
555
|
-
LogMessageUtils.error(
|
|
556
|
-
"Exited",
|
|
557
337
|
"Invalid argument",
|
|
558
|
-
cmdSysNotFoundStackTrace.stack,
|
|
559
|
-
"The command was not found in the system's PATH or is misspelled",
|
|
560
338
|
503 /* SERVICE_UNAVAILABLE */
|
|
561
339
|
);
|
|
340
|
+
this.logger.error(this.stackTrace.message, "Exited", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
562
341
|
break;
|
|
563
342
|
case 130:
|
|
564
|
-
|
|
343
|
+
this.stackTrace = this.traceError(
|
|
565
344
|
"Indicates that the script was manually terminated by the user using the Control-C (SIGINT) signal",
|
|
566
|
-
"Exited",
|
|
567
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
568
|
-
);
|
|
569
|
-
LogMessageUtils.error(
|
|
570
|
-
"Exited",
|
|
571
345
|
"Script terminated",
|
|
572
|
-
endScriptStackTrace.stack,
|
|
573
|
-
"Indicates that the script was manually terminated by the user using the Control-C (SIGINT) signal",
|
|
574
346
|
503 /* SERVICE_UNAVAILABLE */
|
|
575
347
|
);
|
|
348
|
+
this.logger.error(this.stackTrace.message, "Exited", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
576
349
|
break;
|
|
577
350
|
case 137:
|
|
578
|
-
|
|
351
|
+
this.stackTrace = this.traceError(
|
|
579
352
|
"Indicates that the process was terminated by a SIGKILL signal, possibly due to an out-of-memory situation",
|
|
580
|
-
"Exited",
|
|
581
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
582
|
-
);
|
|
583
|
-
LogMessageUtils.error(
|
|
584
|
-
"Exited",
|
|
585
353
|
"SIGKILL",
|
|
586
|
-
prcKillStackTrace.stack,
|
|
587
|
-
"Indicates that the process was terminated by a SIGKILL signal, possibly due to an out-of-memory situation",
|
|
588
354
|
503 /* SERVICE_UNAVAILABLE */
|
|
589
355
|
);
|
|
356
|
+
this.logger.error(this.stackTrace.message, "Exited", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
590
357
|
break;
|
|
591
358
|
case 139:
|
|
592
|
-
|
|
359
|
+
this.stackTrace = this.traceError(
|
|
593
360
|
"Indicates that the process accessed an illegal memory address (segfault)",
|
|
594
|
-
"Exited",
|
|
595
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
596
|
-
);
|
|
597
|
-
LogMessageUtils.error(
|
|
598
|
-
"Exited",
|
|
599
361
|
"Segmentation fault",
|
|
600
|
-
illegalAccessStackTrace.stack,
|
|
601
|
-
"Indicates that the process accessed an illegal memory address (segfault)",
|
|
602
362
|
503 /* SERVICE_UNAVAILABLE */
|
|
603
363
|
);
|
|
364
|
+
this.logger.error(this.stackTrace.message, "Exited", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
604
365
|
break;
|
|
605
366
|
case 143:
|
|
606
|
-
|
|
367
|
+
this.stackTrace = this.traceError(
|
|
607
368
|
"Indicates that the process received a SIGTERM signal to terminate",
|
|
608
|
-
"Exited",
|
|
609
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
610
|
-
);
|
|
611
|
-
LogMessageUtils.error(
|
|
612
|
-
"Exited",
|
|
613
369
|
"process received a SIGTERM",
|
|
614
|
-
sigtermStackTrace.stack,
|
|
615
|
-
"Indicates that the process received a SIGTERM signal to terminate",
|
|
616
370
|
503 /* SERVICE_UNAVAILABLE */
|
|
617
371
|
);
|
|
372
|
+
this.logger.error(this.stackTrace.message, "Exited", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
618
373
|
break;
|
|
619
374
|
case 255:
|
|
620
|
-
|
|
375
|
+
this.stackTrace = this.traceError(
|
|
621
376
|
"An exit code that is outside the allowable range (0-255 for Unix-like systems)",
|
|
622
|
-
"Exited",
|
|
623
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
624
|
-
);
|
|
625
|
-
LogMessageUtils.error(
|
|
626
|
-
"Exited",
|
|
627
377
|
"out of range",
|
|
628
|
-
outsideStackTrace.stack,
|
|
629
|
-
"An exit code that is outside the allowable range (0-255 for Unix-like systems)",
|
|
630
378
|
503 /* SERVICE_UNAVAILABLE */
|
|
631
379
|
);
|
|
380
|
+
this.logger.error(this.stackTrace.message, "Exited", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
632
381
|
break;
|
|
633
382
|
default:
|
|
634
|
-
|
|
383
|
+
this.stackTrace = this.traceError(
|
|
635
384
|
"Error is occurring",
|
|
636
|
-
"Exited",
|
|
637
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
638
|
-
);
|
|
639
|
-
LogMessageUtils.error(
|
|
640
|
-
"Exited",
|
|
641
385
|
"errors",
|
|
642
|
-
globalStackTrace.stack,
|
|
643
|
-
"Error is occurring",
|
|
644
386
|
503 /* SERVICE_UNAVAILABLE */
|
|
645
387
|
);
|
|
388
|
+
this.logger.error(this.stackTrace.message, "Exited", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
646
389
|
break;
|
|
647
390
|
}
|
|
648
391
|
}
|
|
392
|
+
/**
|
|
393
|
+
*
|
|
394
|
+
* @param promise
|
|
395
|
+
*/
|
|
649
396
|
static promiseRejectionHandled(promise) {
|
|
650
|
-
|
|
397
|
+
this.stackTrace = this.traceError(
|
|
651
398
|
`Promise rejection is handled at : ${promise}`,
|
|
652
399
|
"rejection promise",
|
|
653
400
|
503 /* SERVICE_UNAVAILABLE */
|
|
654
401
|
);
|
|
655
|
-
|
|
656
|
-
"PromiseRejectionHandled",
|
|
657
|
-
"rejection promise",
|
|
658
|
-
globalStackTrace.stack,
|
|
659
|
-
`Promise rejection is handled at : ${promise}`,
|
|
660
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
661
|
-
);
|
|
402
|
+
this.logger.error(this.stackTrace.message, "PromiseRejectionHandled", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
662
403
|
}
|
|
404
|
+
/**
|
|
405
|
+
*
|
|
406
|
+
* @param error
|
|
407
|
+
*/
|
|
663
408
|
static uncaughtException(error) {
|
|
664
409
|
if (error.message === "'app.router' is deprecated!\nPlease see the 3.x to 4.x migration guide for details on how to update your app.") {
|
|
665
410
|
console.log("");
|
|
666
411
|
} else {
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
"uncaught exception handled",
|
|
670
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
671
|
-
);
|
|
672
|
-
LogMessageUtils.error(
|
|
673
|
-
"UncaughtException",
|
|
674
|
-
"uncaught exception handled",
|
|
675
|
-
tackTrace.stack,
|
|
676
|
-
error.message,
|
|
677
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
678
|
-
);
|
|
412
|
+
this.stackTrace = this.traceError(error.message, "uncaught exception handled", 503 /* SERVICE_UNAVAILABLE */);
|
|
413
|
+
this.logger.error(this.stackTrace.message, "UncaughtException", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
679
414
|
}
|
|
680
415
|
}
|
|
416
|
+
/**
|
|
417
|
+
*
|
|
418
|
+
* @param error
|
|
419
|
+
*/
|
|
681
420
|
static uncaughtExceptionMonitor(error) {
|
|
682
421
|
if (error.message === "'app.router' is deprecated!\nPlease see the 3.x to 4.x migration guide for details on how to update your app.") {
|
|
683
422
|
console.log("");
|
|
684
423
|
}
|
|
685
424
|
}
|
|
425
|
+
/**
|
|
426
|
+
*
|
|
427
|
+
* @param reason
|
|
428
|
+
* @param promise
|
|
429
|
+
*/
|
|
686
430
|
static unhandledRejection(reason, promise) {
|
|
687
|
-
|
|
431
|
+
this.stackTrace = this.traceError(
|
|
688
432
|
`Unhandled Rejection at: Promise ${promise} -- reason ${reason}`,
|
|
689
433
|
"Unhandled rejection",
|
|
690
434
|
503 /* SERVICE_UNAVAILABLE */
|
|
691
435
|
);
|
|
692
|
-
|
|
693
|
-
"UnhandledRejection",
|
|
694
|
-
"Unhandled rejection",
|
|
695
|
-
stackTrace.stack,
|
|
696
|
-
`Unhandled Rejection at: Promise ${promise} -- reason ${reason}`,
|
|
697
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
698
|
-
);
|
|
436
|
+
this.logger.error(this.stackTrace.message, "UnhandledRejection", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
699
437
|
}
|
|
438
|
+
/**
|
|
439
|
+
*
|
|
440
|
+
* @param warning
|
|
441
|
+
*/
|
|
700
442
|
static warning(warning) {
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
"Warning",
|
|
704
|
-
"warning",
|
|
705
|
-
stackTrace.stack,
|
|
706
|
-
warning.message,
|
|
707
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
708
|
-
);
|
|
443
|
+
this.stackTrace = this.traceError(warning.message, "warning", 503 /* SERVICE_UNAVAILABLE */);
|
|
444
|
+
this.logger.error(this.stackTrace.message, "Warning", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
709
445
|
}
|
|
446
|
+
/**
|
|
447
|
+
*
|
|
448
|
+
* @param message
|
|
449
|
+
*/
|
|
710
450
|
static message(message) {
|
|
711
|
-
|
|
451
|
+
this.stackTrace = this.traceError(
|
|
712
452
|
`process got message ${message}`,
|
|
713
453
|
"message exception",
|
|
714
454
|
503 /* SERVICE_UNAVAILABLE */
|
|
715
455
|
);
|
|
716
|
-
|
|
717
|
-
"Message",
|
|
718
|
-
"message exception",
|
|
719
|
-
stackTrace.stack,
|
|
720
|
-
`process got message ${message}`,
|
|
721
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
722
|
-
);
|
|
456
|
+
this.logger.error(this.stackTrace.message, "Message", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
723
457
|
}
|
|
458
|
+
/**
|
|
459
|
+
*
|
|
460
|
+
* @param type
|
|
461
|
+
* @param promise
|
|
462
|
+
* @param reason
|
|
463
|
+
*/
|
|
724
464
|
static multipleResolves(type, promise, reason) {
|
|
725
|
-
|
|
465
|
+
this.stackTrace = this.traceError(
|
|
726
466
|
`${promise} -- ${reason}`,
|
|
727
|
-
"multipleResolves",
|
|
728
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
729
|
-
);
|
|
730
|
-
LogMessageUtils.error(
|
|
731
|
-
"multipleResolves",
|
|
732
467
|
`Multiple resolves detected : ${type}`,
|
|
733
|
-
stackTrace.stack,
|
|
734
|
-
`${promise} -- ${reason}`,
|
|
735
468
|
503 /* SERVICE_UNAVAILABLE */
|
|
736
469
|
);
|
|
470
|
+
this.logger.error(this.stackTrace.message, "multipleResolves", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
737
471
|
}
|
|
472
|
+
/**
|
|
473
|
+
*
|
|
474
|
+
*/
|
|
738
475
|
static processInterrupted() {
|
|
739
|
-
|
|
740
|
-
"[ OK ] Success",
|
|
741
|
-
`Process ${import_process.default.pid} has been interrupted`,
|
|
742
|
-
"The Web server has been stopped !"
|
|
743
|
-
);
|
|
476
|
+
this.logger.success("[ OK ] Success", "The Web server has been stopped !");
|
|
744
477
|
import_process.default.exit(0);
|
|
745
478
|
}
|
|
479
|
+
/**
|
|
480
|
+
*
|
|
481
|
+
* @param signal
|
|
482
|
+
*/
|
|
746
483
|
static sigtermSignalReceived(signal) {
|
|
747
|
-
|
|
748
|
-
`Process ${import_process.default.pid} received a SIGTERM signal`,
|
|
749
|
-
"SIGTERM",
|
|
750
|
-
406 /* NOT_ACCEPTABLE */
|
|
751
|
-
);
|
|
752
|
-
LogMessageUtils.error(
|
|
753
|
-
"SIGTERM",
|
|
754
|
-
"SIGTERM",
|
|
755
|
-
stackTrace.stack,
|
|
484
|
+
this.stackTrace = this.traceError(
|
|
756
485
|
`Process ${import_process.default.pid} received a SIGTERM signal : ${signal.toString()}`,
|
|
486
|
+
"SIGTERM",
|
|
757
487
|
406 /* NOT_ACCEPTABLE */
|
|
758
488
|
);
|
|
489
|
+
this.logger.error(this.stackTrace.message, "SIGTERM", this.stackTrace.name, this.stackTrace.stack, 406 /* NOT_ACCEPTABLE */);
|
|
759
490
|
import_process.default.exit(0);
|
|
760
491
|
}
|
|
492
|
+
/**
|
|
493
|
+
*
|
|
494
|
+
*/
|
|
761
495
|
static serverClosing() {
|
|
762
|
-
console.log(`${
|
|
496
|
+
console.log(`${import_ansi_colors2.default.bgCyanBright(` ${import_ansi_colors2.default.bold(`${import_ansi_colors2.default.white(` INFO `)}`)}`)} All processes are stopped`);
|
|
763
497
|
console.log(" Server is closed");
|
|
764
498
|
import_process.default.exit();
|
|
765
499
|
}
|
|
500
|
+
/**
|
|
501
|
+
*
|
|
502
|
+
*/
|
|
766
503
|
static dropNewConnection() {
|
|
767
|
-
console.log(`${
|
|
504
|
+
console.log(`${import_ansi_colors2.default.cyan(`\u24D8`)} ${import_ansi_colors2.default.bgCyan(` ${import_ansi_colors2.default.bold(`${import_ansi_colors2.default.white(` Server maxConnection `)}`)} `)} ${dateTimeFormattedUtils} | ${import_ansi_colors2.default.bgCyan(`${import_ansi_colors2.default.white(` Info `)}`)} The server dropped new connections`);
|
|
768
505
|
}
|
|
506
|
+
/**
|
|
507
|
+
*
|
|
508
|
+
* @param errorEmitter
|
|
509
|
+
* @param err
|
|
510
|
+
* @param req
|
|
511
|
+
* @param res
|
|
512
|
+
* @param next
|
|
513
|
+
*/
|
|
769
514
|
static expressErrorHandlingMiddleware(errorEmitter, err, req, res, next) {
|
|
770
515
|
if (err) {
|
|
771
516
|
errorEmitter.emit(CEventNameError.error, err);
|
|
@@ -774,14 +519,8 @@ var ServerListenEventError2 = class {
|
|
|
774
519
|
} else {
|
|
775
520
|
console.error("res.status is not a function");
|
|
776
521
|
}
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
"Express error-handling middleware",
|
|
780
|
-
"Express error",
|
|
781
|
-
stackTrace.stack,
|
|
782
|
-
err.message,
|
|
783
|
-
503 /* SERVICE_UNAVAILABLE */
|
|
784
|
-
);
|
|
522
|
+
this.stackTrace = this.traceError(err.message, "Express error", 406 /* NOT_ACCEPTABLE */);
|
|
523
|
+
this.logger.error(this.stackTrace.message, "Express error-handling middleware", this.stackTrace.name, this.stackTrace.stack, 503 /* SERVICE_UNAVAILABLE */);
|
|
785
524
|
} else {
|
|
786
525
|
next();
|
|
787
526
|
}
|
|
@@ -790,6 +529,137 @@ var ServerListenEventError2 = class {
|
|
|
790
529
|
return new StackTraceError(props, name, status, true);
|
|
791
530
|
}
|
|
792
531
|
};
|
|
532
|
+
ServerListenEventError.logger = new import_opticore_logger.LoggerCore();
|
|
533
|
+
|
|
534
|
+
// src/core/handlers/eventProcess.handler.ts
|
|
535
|
+
function eventProcessHandler() {
|
|
536
|
+
const errorEmitter = new import_node_events.default();
|
|
537
|
+
const app = (0, import_express.default)();
|
|
538
|
+
errorEmitter.on(CEventNameError.error, (error) => {
|
|
539
|
+
ServerListenEventError.listenerError(error);
|
|
540
|
+
});
|
|
541
|
+
import_node_process.default.on(CEvent.beforeExit, (code) => {
|
|
542
|
+
setTimeout(() => {
|
|
543
|
+
ServerListenEventError.processBeforeExit(code);
|
|
544
|
+
}, 100);
|
|
545
|
+
});
|
|
546
|
+
import_node_process.default.on(CEvent.disconnect, () => {
|
|
547
|
+
ServerListenEventError.processDisconnected();
|
|
548
|
+
});
|
|
549
|
+
import_node_process.default.on(CEvent.exit, (code) => {
|
|
550
|
+
ServerListenEventError.exited(code);
|
|
551
|
+
});
|
|
552
|
+
import_node_process.default.on(CEvent.rejectionHandled, (promise) => {
|
|
553
|
+
ServerListenEventError.promiseRejectionHandled(promise);
|
|
554
|
+
});
|
|
555
|
+
import_node_process.default.on(CEvent.uncaughtException, (error) => {
|
|
556
|
+
ServerListenEventError.uncaughtException(error);
|
|
557
|
+
});
|
|
558
|
+
import_node_process.default.on(CEvent.uncaughtExceptionMonitor, (error) => {
|
|
559
|
+
ServerListenEventError.uncaughtExceptionMonitor(error);
|
|
560
|
+
});
|
|
561
|
+
import_node_process.default.on(CEvent.unhandledRejection, (reason, promise) => {
|
|
562
|
+
ServerListenEventError.unhandledRejection(reason, promise);
|
|
563
|
+
});
|
|
564
|
+
import_node_process.default.on(CEvent.warning, (warning) => {
|
|
565
|
+
ServerListenEventError.warning(warning);
|
|
566
|
+
});
|
|
567
|
+
import_node_process.default.on(CEvent.message, (message) => {
|
|
568
|
+
ServerListenEventError.message(message);
|
|
569
|
+
});
|
|
570
|
+
import_node_process.default.on(CEvent.multipleResolves, (type, promise, reason) => {
|
|
571
|
+
ServerListenEventError.multipleResolves(type, promise, reason);
|
|
572
|
+
});
|
|
573
|
+
import_node_process.default.on(CEvent.sigint, () => {
|
|
574
|
+
ServerListenEventError.processInterrupted();
|
|
575
|
+
});
|
|
576
|
+
import_node_process.default.on(CEvent.sigterm, (signal) => {
|
|
577
|
+
ServerListenEventError.sigtermSignalReceived(signal);
|
|
578
|
+
});
|
|
579
|
+
app.use((err, req, res, next) => {
|
|
580
|
+
ServerListenEventError.expressErrorHandlingMiddleware(errorEmitter, err, req, res, next);
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
// src/core/events/requestCalls.event.ts
|
|
585
|
+
var import_ansi_colors3 = __toESM(require("ansi-colors"), 1);
|
|
586
|
+
var import_opticore_logger2 = require("opticore-logger");
|
|
587
|
+
function requestCallsEvent(req, res, host, port, loadingTime) {
|
|
588
|
+
const logger = new import_opticore_logger2.LoggerCore();
|
|
589
|
+
const currentDatePath = `Request called`;
|
|
590
|
+
if (req.originalUrl === "undefined") {
|
|
591
|
+
console.log(`[ ${import_ansi_colors3.default.red(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors3.default.bgRed(`${import_ansi_colors3.default.white(` Not found `)}`)} [ Host ] http://${host}:${port} - [ Route ] The route do not exist. - [ Status ] ${import_ansi_colors3.default.red(`${import_ansi_colors3.default.white(` 404 `)}`)}`);
|
|
592
|
+
logger.error("The route do not exist.");
|
|
593
|
+
} else {
|
|
594
|
+
switch (res.statusCode) {
|
|
595
|
+
case 200:
|
|
596
|
+
switch (req.method) {
|
|
597
|
+
case "POST":
|
|
598
|
+
logger.info(`[ ${import_ansi_colors3.default.cyan(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors3.default.bgGreen(`${import_ansi_colors3.default.white(` Success `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${import_ansi_colors3.default.bgCyan(`${import_ansi_colors3.default.white(` 200 `)}`)}`);
|
|
599
|
+
break;
|
|
600
|
+
case "GET":
|
|
601
|
+
case "PUT":
|
|
602
|
+
logger.info(`[ ${import_ansi_colors3.default.cyan(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors3.default.bgGreen(`${import_ansi_colors3.default.white(` Success `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${import_ansi_colors3.default.bgCyan(`${import_ansi_colors3.default.white(` 200 `)}`)}`);
|
|
603
|
+
break;
|
|
604
|
+
case "DELETE":
|
|
605
|
+
logger.info(`[ ${import_ansi_colors3.default.cyan(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors3.default.bgGreen(`${import_ansi_colors3.default.white(` Success `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${import_ansi_colors3.default.bgCyan(`${import_ansi_colors3.default.white(` 200 `)}`)}`);
|
|
606
|
+
break;
|
|
607
|
+
}
|
|
608
|
+
break;
|
|
609
|
+
case 404:
|
|
610
|
+
switch (req.method) {
|
|
611
|
+
case "POST":
|
|
612
|
+
console.log(`[ ${import_ansi_colors3.default.red(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors3.default.bgRed(`${import_ansi_colors3.default.white(` Not found `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${import_ansi_colors3.default.red(`${import_ansi_colors3.default.white(` 404 `)}`)}`);
|
|
613
|
+
break;
|
|
614
|
+
case "GET":
|
|
615
|
+
console.log(`[ ${import_ansi_colors3.default.red(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors3.default.bgRed(`${import_ansi_colors3.default.white(` Not found `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${import_ansi_colors3.default.red(`${import_ansi_colors3.default.bold(` 404 `)}`)}`);
|
|
616
|
+
break;
|
|
617
|
+
case "PUT":
|
|
618
|
+
console.log(`[ ${import_ansi_colors3.default.red(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors3.default.bgRed(`${import_ansi_colors3.default.white(` Not found `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${import_ansi_colors3.default.red(`${import_ansi_colors3.default.bold(` 404 `)}`)}`);
|
|
619
|
+
break;
|
|
620
|
+
case "DELETE":
|
|
621
|
+
console.log(`[ ${import_ansi_colors3.default.red(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors3.default.bgRed(`${import_ansi_colors3.default.white(` Not found `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${import_ansi_colors3.default.red(`${import_ansi_colors3.default.bold(` 404 `)}`)}`);
|
|
622
|
+
break;
|
|
623
|
+
}
|
|
624
|
+
break;
|
|
625
|
+
case 401:
|
|
626
|
+
switch (req.method) {
|
|
627
|
+
case "POST":
|
|
628
|
+
console.log(`[ ${import_ansi_colors3.default.yellowBright(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors3.default.bgYellowBright(`${import_ansi_colors3.default.white(` Unauthorized `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${import_ansi_colors3.default.bgYellow(`${import_ansi_colors3.default.bold(` 401 `)}`)}`);
|
|
629
|
+
break;
|
|
630
|
+
case "GET":
|
|
631
|
+
console.log(`[ ${import_ansi_colors3.default.yellowBright(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors3.default.bgYellowBright(`${import_ansi_colors3.default.white(` Unauthorized `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${import_ansi_colors3.default.bgYellow(`${import_ansi_colors3.default.bold(` 401 `)}`)}`);
|
|
632
|
+
break;
|
|
633
|
+
case "PUT":
|
|
634
|
+
console.log(`[ ${import_ansi_colors3.default.yellowBright(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors3.default.bgYellowBright(`${import_ansi_colors3.default.white(` Unauthorized `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${import_ansi_colors3.default.bgYellow(`${import_ansi_colors3.default.bold(` 401 `)}`)}`);
|
|
635
|
+
break;
|
|
636
|
+
case "DELETE":
|
|
637
|
+
console.log(`[ ${import_ansi_colors3.default.yellowBright(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors3.default.bgYellowBright(`${import_ansi_colors3.default.white(` Unauthorized `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${import_ansi_colors3.default.bgYellow(`${import_ansi_colors3.default.bold(` 401 `)}`)}`);
|
|
638
|
+
break;
|
|
639
|
+
}
|
|
640
|
+
break;
|
|
641
|
+
case 500:
|
|
642
|
+
switch (req.method) {
|
|
643
|
+
case "POST":
|
|
644
|
+
console.log(`[ ${import_ansi_colors3.default.red(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors3.default.bgRed(`${import_ansi_colors3.default.white(` Server error `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${import_ansi_colors3.default.red(`${import_ansi_colors3.default.bold(` 500 `)}`)}`);
|
|
645
|
+
break;
|
|
646
|
+
case "GET":
|
|
647
|
+
console.log(`[ ${import_ansi_colors3.default.red(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors3.default.bgRed(`${import_ansi_colors3.default.white(` Server error `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${import_ansi_colors3.default.red(`${import_ansi_colors3.default.bold(` 500 `)}`)}`);
|
|
648
|
+
break;
|
|
649
|
+
case "PUT":
|
|
650
|
+
console.log(`[ ${import_ansi_colors3.default.red(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors3.default.bgRed(`${import_ansi_colors3.default.white(` Server error `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${import_ansi_colors3.default.red(`${import_ansi_colors3.default.bold(` 500 `)}`)}`);
|
|
651
|
+
break;
|
|
652
|
+
case "DELETE":
|
|
653
|
+
console.log(`[ ${import_ansi_colors3.default.red(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors3.default.bgRed(`${import_ansi_colors3.default.white(` Server error `)}`)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ query ] ${JSON.stringify(req.query)} - [ params ] ${JSON.stringify(req.params)} - [ Status ] ${import_ansi_colors3.default.red(`${import_ansi_colors3.default.bold(` 500 `)}`)}`);
|
|
654
|
+
break;
|
|
655
|
+
}
|
|
656
|
+
break;
|
|
657
|
+
default:
|
|
658
|
+
console.log(`[ ${import_ansi_colors3.default.blueBright(`${currentDatePath}`)} ] ${loadingTime} | ${import_ansi_colors3.default.blueBright(` ${res.statusMessage} `)} [ Host ] http://${host}:${port} - [ Route ] ${req.originalUrl} - [ Status ] ${import_ansi_colors3.default.blueBright(` ${res.req.socket._httpMessage.statusCode} `)}`);
|
|
659
|
+
break;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
}
|
|
793
663
|
|
|
794
664
|
// src/application/service/core.service.ts
|
|
795
665
|
var import_node_process2 = __toESM(require("process"), 1);
|
|
@@ -800,6 +670,28 @@ var import_ansi_colors6 = __toESM(require("ansi-colors"), 1);
|
|
|
800
670
|
|
|
801
671
|
// src/core/utils/modulesLoaded.utils.ts
|
|
802
672
|
var import_ansi_colors5 = __toESM(require("ansi-colors"), 1);
|
|
673
|
+
|
|
674
|
+
// src/core/utils/logMessage.utils.ts
|
|
675
|
+
var import_ansi_colors4 = __toESM(require("ansi-colors"), 1);
|
|
676
|
+
var LogMessageUtils = class {
|
|
677
|
+
static success(title, action, contentAction) {
|
|
678
|
+
console.log(`${import_ansi_colors4.default.green(`\u2714`)} ${import_ansi_colors4.default.bgGreen(` ${import_ansi_colors4.default.bold(`${import_ansi_colors4.default.white(`${title}`)}`)} `)} ${dateTimeFormattedUtils} | ${import_ansi_colors4.default.bgGreen(`${import_ansi_colors4.default.white(` Success `)}`)} [ ${action} ] ${contentAction} - [ Status ] ${import_ansi_colors4.default.bgGreen(`${import_ansi_colors4.default.white(` 200 `)}`)}`);
|
|
679
|
+
}
|
|
680
|
+
static warning(title, action, contentAction) {
|
|
681
|
+
console.warn(`${import_ansi_colors4.default.yellow(`\u26A0\uFE0F`)} ${import_ansi_colors4.default.bgYellow(` ${import_ansi_colors4.default.bold(`${import_ansi_colors4.default.white(`${title}`)}`)} `)} ${dateTimeFormattedUtils} | ${import_ansi_colors4.default.bgYellow(`${import_ansi_colors4.default.white(` Warning `)}`)} ${contentAction}`);
|
|
682
|
+
}
|
|
683
|
+
static info(title, action, contentAction) {
|
|
684
|
+
console.info(`${import_ansi_colors4.default.cyan(`\u24D8`)} ${import_ansi_colors4.default.bgCyan(` ${import_ansi_colors4.default.bold(`${import_ansi_colors4.default.white(`${title}`)}`)} `)} ${dateTimeFormattedUtils} | ${import_ansi_colors4.default.bgCyan(`${import_ansi_colors4.default.white(` Info `)}`)} ${contentAction}`);
|
|
685
|
+
}
|
|
686
|
+
static error(title, errorType, stackTrace, messageContent, httpCodeValue) {
|
|
687
|
+
console.error(`${import_ansi_colors4.default.red(`\u2718`)} ${import_ansi_colors4.default.bgRed(` ${import_ansi_colors4.default.bold(`${import_ansi_colors4.default.white(`${title}`)}`)} `)} | ${dateTimeFormattedUtils} | [ ${import_ansi_colors4.default.red(`${import_ansi_colors4.default.bold(` ${errorType} `)}`)} ] | [ ${import_ansi_colors4.default.bold(`stack trace`)} ] ${import_ansi_colors4.default.red(`${stackTrace}`)} - ${import_ansi_colors4.default.red(`${messageContent}`)} - [ ${import_ansi_colors4.default.red(`${import_ansi_colors4.default.bold(` HttpCode `)}`)} ] ${import_ansi_colors4.default.red(`${import_ansi_colors4.default.bold(` ${httpCodeValue} `)}`)} `);
|
|
688
|
+
}
|
|
689
|
+
static requestError(title, errorName, errorMessage, errorCode) {
|
|
690
|
+
console.error(`[ ${import_ansi_colors4.default.red(`${title}`)} ] ${dateTimeFormattedUtils} | ${import_ansi_colors4.default.bgRed(`${import_ansi_colors4.default.white(` ERROR `)}`)} ${import_ansi_colors4.default.red(`[ ${errorName} ]`)} ${import_ansi_colors4.default.red(`${errorMessage}`)} - [ Status ] ${import_ansi_colors4.default.bgRed(`${import_ansi_colors4.default.white(` ${errorCode} `)}`)}`);
|
|
691
|
+
}
|
|
692
|
+
};
|
|
693
|
+
|
|
694
|
+
// src/core/utils/modulesLoaded.utils.ts
|
|
803
695
|
function modulesLoadedUtils(allAppRoutes, dbConChecker) {
|
|
804
696
|
LogMessageUtils.success("Kernel", "load kernel", "Modules app have been successfully loaded");
|
|
805
697
|
console.log(`${import_ansi_colors5.default.whiteBright(` content`)} ${import_ansi_colors5.default.green("Kernel :")} ${import_ansi_colors5.default.cyan(`${import_ansi_colors5.default.bold(`server side`)}`)} has been loaded successfully ${import_ansi_colors5.default.green(`\u2714`)}`);
|
|
@@ -978,11 +870,11 @@ var WebServerCore = class {
|
|
|
978
870
|
() => {
|
|
979
871
|
try {
|
|
980
872
|
if (this.host === "" && this.port === 0) {
|
|
981
|
-
|
|
873
|
+
ServerListenEventError.hostPortUndefined();
|
|
982
874
|
} else if (this.host === "") {
|
|
983
|
-
|
|
875
|
+
ServerListenEventError.hostUndefined();
|
|
984
876
|
} else if (this.port === 0) {
|
|
985
|
-
|
|
877
|
+
ServerListenEventError.portUndefined();
|
|
986
878
|
} else {
|
|
987
879
|
this.registerRoutes(routers);
|
|
988
880
|
}
|
|
@@ -994,11 +886,11 @@ var WebServerCore = class {
|
|
|
994
886
|
}
|
|
995
887
|
onListeningOnServerEvent(serverWeb, kernelModule) {
|
|
996
888
|
serverWeb.on(CEventNameError.error, (err) => {
|
|
997
|
-
|
|
889
|
+
ServerListenEventError.onEventError(err);
|
|
998
890
|
}).on(CEventNameError.close, () => {
|
|
999
|
-
|
|
891
|
+
ServerListenEventError.serverClosing();
|
|
1000
892
|
}).on(CEventNameError.drop, () => {
|
|
1001
|
-
|
|
893
|
+
ServerListenEventError.dropNewConnection();
|
|
1002
894
|
}).on(CEventNameError.listening, () => {
|
|
1003
895
|
this.infoWebApp();
|
|
1004
896
|
this.serverUtility.coreListenerEventLoaderModuleService(kernelModule);
|