opticore-catch-exception-error 1.0.12 → 1.0.14

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.d.ts CHANGED
@@ -3,16 +3,43 @@ import EventEmitter from 'node:events';
3
3
  import { Request, Response, NextFunction } from 'opticore-express';
4
4
 
5
5
  declare const CErrorName: {
6
+ assertionError: string;
7
+ beforeExit: string;
8
+ eacces: string;
9
+ eaddrinuse: string;
10
+ econnrefused: string;
11
+ econnreset: string;
12
+ eexist: string;
13
+ error: string;
14
+ eisdir: string;
15
+ emfile: string;
16
+ enoent: string;
17
+ enotdir: string;
18
+ enotEmpty: string;
19
+ eperm: string;
20
+ epipe: string;
21
+ etimedout: string;
6
22
  evalError: string;
7
- syntaxError: string;
23
+ errOsslEvpUnsupported: string;
24
+ errOsslBadDecrypt: string;
25
+ errOsslWrongFinalBlockLength: string;
26
+ errInvalidArgType: string;
27
+ errInvalidCallback: string;
28
+ errHttpHeadersSent: string;
29
+ errStreamDestroyed: string;
30
+ errTlsCertAltnameInvalid: string;
31
+ errUnsupportedEsmUrlScheme: string;
32
+ exit: string;
33
+ generalError: string;
34
+ openSSLError: string;
8
35
  rangeError: string;
9
36
  referenceError: string;
37
+ systemError: string;
38
+ syntaxError: string;
10
39
  typeError: string;
11
40
  uriError: string;
12
- systemError: string;
13
- assertionError: string;
14
- openSSLError: string;
15
- generalError: string;
41
+ uncaughtException: string;
42
+ unhandledRejection: string;
16
43
  };
17
44
 
18
45
  declare const CEvent: {
@@ -128,100 +155,104 @@ declare class StackTraceURIError extends StackTraceError {
128
155
  }
129
156
 
130
157
  declare class ServerListenEventError {
131
- private static logger;
132
- private static stackTrace;
133
- static __init(defaultLocalLang: string): typeof ServerListenEventError;
158
+ private logger;
159
+ private stackTrace?;
160
+ private readonly localeLanguage;
161
+ constructor(defaultLocalLang: string);
134
162
  /**
163
+ * @param appPort
135
164
  *
136
165
  */
137
- static hostPortUndefined(): void;
166
+ hostPortUndefined(appPort: any): void;
138
167
  /**
168
+ * @param appHost
139
169
  *
140
170
  */
141
- static hostUndefined(): void;
171
+ hostUndefined(appHost: string): void;
142
172
  /**
143
173
  *
144
174
  */
145
- static portUndefined(): void;
175
+ portUndefined(): void;
146
176
  /**
147
- *
148
177
  * @param err
178
+ *
149
179
  */
150
- static onEventError(err: Error): void;
180
+ onEventError(err: Error): void;
151
181
  /**
152
182
  *
153
183
  * @param error
154
184
  */
155
- static listenerError(error: Error): void;
185
+ listenerError(error: Error): void;
156
186
  /**
157
- *
158
187
  * @param code
188
+ *
159
189
  */
160
- static processBeforeExit(code: number): void;
190
+ processBeforeExit(code: number): void;
161
191
  /**
162
192
  *
163
193
  */
164
- static processDisconnected(): void;
194
+ processDisconnected(): void;
165
195
  /**
166
196
  *
167
197
  * @param code
168
198
  */
169
- static exited(code: number): void;
199
+ exited(code: number): void;
170
200
  /**
171
201
  *
172
202
  * @param promise
173
203
  */
174
- static promiseRejectionHandled(promise: Promise<any>): void;
204
+ promiseRejectionHandled(promise: Promise<any>): void;
175
205
  /**
176
206
  *
177
207
  * @param error
178
208
  */
179
- static uncaughtException(error: any): void;
209
+ uncaughtException(error: any): void;
180
210
  /**
181
211
  *
182
212
  * @param error
183
213
  */
184
- static uncaughtExceptionMonitor(error: any): void;
214
+ uncaughtExceptionMonitor(error: any): void;
185
215
  /**
186
216
  *
187
217
  * @param reason
188
218
  * @param promise
189
219
  */
190
- static unhandledRejection(reason: any, promise: Promise<any>): void;
220
+ unhandledRejection(reason: any, promise: Promise<any>): void;
191
221
  /**
192
222
  *
193
223
  * @param warning
194
224
  */
195
- static warning(warning: any): void;
225
+ warning(warning: any): void;
196
226
  /**
197
227
  *
198
228
  * @param message
199
229
  */
200
- static message(message: any): void;
230
+ message(message: any): void;
201
231
  /**
202
232
  *
203
233
  * @param type
204
234
  * @param promise
205
235
  * @param reason
206
236
  */
207
- static multipleResolves(type: string, promise: Promise<any>, reason: any): void;
237
+ multipleResolves(type: string, promise: Promise<any>, reason: any): void;
208
238
  /**
209
239
  *
210
240
  */
211
- static processInterrupted(): void;
241
+ processInterrupted(): void;
212
242
  /**
213
243
  *
214
244
  * @param signal
245
+ * @param defaultLocalLang
215
246
  */
216
- static sigtermSignalReceived(signal: any): void;
247
+ sigtermSignalReceived(signal: any, defaultLocalLang: string): void;
217
248
  /**
218
249
  *
219
250
  */
220
- static serverClosing(): void;
251
+ serverClosing(): void;
221
252
  /**
222
253
  *
223
254
  */
224
- static dropNewConnection(): void;
255
+ dropNewConnection(): void;
225
256
  /**
226
257
  *
227
258
  * @param errorEmitter
@@ -230,8 +261,190 @@ declare class ServerListenEventError {
230
261
  * @param res
231
262
  * @param next
232
263
  */
233
- static expressErrorHandlingMiddleware(errorEmitter: EventEmitter, err: Error, req: Request, res: Response, next: NextFunction): void;
234
- private static traceError;
264
+ expressErrorHandlingMiddleware(errorEmitter: EventEmitter, err: Error, req: Request, res: Response, next: NextFunction): void;
265
+ private traceError;
266
+ }
267
+
268
+ /**
269
+ * Handling and catch a Node.js error.
270
+ */
271
+ declare class StackTraceEACCES extends StackTraceError {
272
+ constructor(message: string);
273
+ }
274
+
275
+ /**
276
+ * Handling and catch a Node.js error.
277
+ */
278
+ declare class StackTraceEADDRINUSE extends StackTraceError {
279
+ constructor(message: string);
280
+ }
281
+
282
+ /**
283
+ * Handling and catch a Node.js error.
284
+ */
285
+ declare class StackTraceECONNREFUSED extends StackTraceError {
286
+ constructor(message: string);
287
+ }
288
+
289
+ /**
290
+ * Handling and catch a Node.js error.
291
+ */
292
+ declare class StackTraceECONNRESET extends StackTraceError {
293
+ constructor(message: string);
294
+ }
295
+
296
+ /**
297
+ * Handling and catch a Node.js error.
298
+ */
299
+ declare class StackTraceEEXIST extends StackTraceError {
300
+ constructor(message: string);
301
+ }
302
+
303
+ /**
304
+ * Handling and catch a Node.js error.
305
+ */
306
+ declare class StackTraceEISDIR extends StackTraceError {
307
+ constructor(message: string);
308
+ }
309
+
310
+ /**
311
+ * Handling and catch a Node.js error.
312
+ */
313
+ declare class StackTraceEMFILE extends StackTraceError {
314
+ constructor(message: string);
315
+ }
316
+
317
+ /**
318
+ * Handling and catch a Node.js error.
319
+ */
320
+ declare class StackTraceENOENT extends StackTraceError {
321
+ constructor(message: string);
322
+ }
323
+
324
+ /**
325
+ * Handling and catch a Node.js error.
326
+ */
327
+ declare class StackTraceENOTDIR extends StackTraceError {
328
+ constructor(message: string);
329
+ }
330
+
331
+ /**
332
+ * Handling and catch a Node.js error.
333
+ */
334
+ declare class StackTraceENOTEMPTY extends StackTraceError {
335
+ constructor(message: string);
336
+ }
337
+
338
+ /**
339
+ * Handling and catch a Node.js error.
340
+ */
341
+ declare class StackTraceEPERM extends StackTraceError {
342
+ constructor(message: string);
343
+ }
344
+
345
+ /**
346
+ * Handling and catch a Node.js error.
347
+ */
348
+ declare class StackTraceEPIPE extends StackTraceError {
349
+ constructor(message: string);
350
+ }
351
+
352
+ /**
353
+ * Handling and catch a Node.js error.
354
+ */
355
+ declare class StackTraceETIMEDOUT extends StackTraceError {
356
+ constructor(message: string);
357
+ }
358
+
359
+ /**
360
+ * Handling and catch a Node.js error.
361
+ */
362
+ declare class StackTraceERR_OSSL_EVP_UNSUPPORTED extends StackTraceError {
363
+ constructor(message: string);
364
+ }
365
+
366
+ /**
367
+ * Handling and catch a Node.js error.
368
+ */
369
+ declare class StackTraceERR_OSSL_BAD_DECRYPT extends StackTraceError {
370
+ constructor(message: string);
371
+ }
372
+
373
+ /**
374
+ * Handling and catch a Node.js error.
375
+ */
376
+ declare class StackTraceERR_OSSL_WRONG_FINAL_BLOCK_LENGTH extends StackTraceError {
377
+ constructor(message: string);
378
+ }
379
+
380
+ /**
381
+ * Handling and catch a Node.js error.
382
+ */
383
+ declare class StackTraceERR_INVALID_ARG_TYPE extends StackTraceError {
384
+ constructor(message: string);
385
+ }
386
+
387
+ /**
388
+ * Handling and catch a Node.js error.
389
+ */
390
+ declare class StackTraceERR_INVALID_CALLBACK extends StackTraceError {
391
+ constructor(message: string);
392
+ }
393
+
394
+ /**
395
+ * Handling and catch a Node.js error.
396
+ */
397
+ declare class StackTraceERR_HTTP_HEADERS_SENT extends StackTraceError {
398
+ constructor(message: string);
399
+ }
400
+
401
+ /**
402
+ * Handling and catch a Node.js error.
403
+ */
404
+ declare class StackTraceERR_STREAM_DESTROYED extends StackTraceError {
405
+ constructor(message: string);
406
+ }
407
+
408
+ /**
409
+ * Handling and catch a Node.js error.
410
+ */
411
+ declare class StackTraceERR_TLS_CERT_ALTNAME_INVALID extends StackTraceError {
412
+ constructor(message: string);
413
+ }
414
+
415
+ /**
416
+ * Handling and catch a Node.js error.
417
+ */
418
+ declare class StackTraceERR_UNSUPPORTED_ESM_URL_SCHEME extends StackTraceError {
419
+ constructor(message: string);
420
+ }
421
+
422
+ /**
423
+ * Handling and catch a Node.js error.
424
+ */
425
+ declare class StackTraceUncaughtException extends StackTraceError {
426
+ constructor(message: string);
427
+ }
428
+
429
+ /**
430
+ * Handling and catch a Node.js error.
431
+ */
432
+ declare class StackTraceUnhandledRejection extends StackTraceError {
433
+ constructor(message: string);
434
+ }
435
+
436
+ /**
437
+ * Handling and catch a Node.js error.
438
+ */
439
+ declare class StackTraceBeforeExit extends StackTraceError {
440
+ constructor(message: string);
441
+ }
442
+
443
+ /**
444
+ * Handling and catch a Node.js error.
445
+ */
446
+ declare class StackTraceExit extends StackTraceError {
447
+ constructor(message: string);
235
448
  }
236
449
 
237
- export { CErrorName, CEvent, CEventNameError, ServerListenEventError, StackTraceAssertionError, StackTraceError, StackTraceEvalError, StackTraceGeneralError, StackTraceOpenSSLError, StackTraceRangeError, StackTraceReferenceError, StackTraceSyntaxError, StackTraceSystemError, StackTraceTypeError, StackTraceURIError };
450
+ export { CErrorName, CEvent, CEventNameError, ServerListenEventError, StackTraceAssertionError, StackTraceBeforeExit, StackTraceEACCES, StackTraceEADDRINUSE, StackTraceECONNREFUSED, StackTraceECONNRESET, StackTraceEEXIST, StackTraceEISDIR, StackTraceEMFILE, StackTraceENOENT, StackTraceENOTDIR, StackTraceENOTEMPTY, StackTraceEPERM, StackTraceEPIPE, StackTraceERR_HTTP_HEADERS_SENT, StackTraceERR_INVALID_ARG_TYPE, StackTraceERR_INVALID_CALLBACK, StackTraceERR_OSSL_BAD_DECRYPT, StackTraceERR_OSSL_EVP_UNSUPPORTED, StackTraceERR_OSSL_WRONG_FINAL_BLOCK_LENGTH, StackTraceERR_STREAM_DESTROYED, StackTraceERR_TLS_CERT_ALTNAME_INVALID, StackTraceERR_UNSUPPORTED_ESM_URL_SCHEME, StackTraceETIMEDOUT, StackTraceError, StackTraceEvalError, StackTraceExit, StackTraceGeneralError, StackTraceOpenSSLError, StackTraceRangeError, StackTraceReferenceError, StackTraceSyntaxError, StackTraceSystemError, StackTraceTypeError, StackTraceURIError, StackTraceUncaughtException, StackTraceUnhandledRejection };