diff --git a/bin/genieacs-cwmp.ts b/bin/genieacs-cwmp.ts index 6910c16..6809b2c 100755 --- a/bin/genieacs-cwmp.ts +++ b/bin/genieacs-cwmp.ts @@ -88,6 +88,11 @@ if (!cluster.worker) { keepAliveTimeout: 0, }; + // Need this for Node < 15 + process.on("unhandledRejection", (err) => { + throw err; + }); + process.on("uncaughtException", (err) => { if ((err as NodeJS.ErrnoException).code === "ERR_IPC_DISCONNECTED") return; logger.error({ diff --git a/bin/genieacs-ext.ts b/bin/genieacs-ext.ts index 864c687..0a35b60 100755 --- a/bin/genieacs-ext.ts +++ b/bin/genieacs-ext.ts @@ -54,6 +54,11 @@ function errorToFault(err: Error): Fault { return fault; } +// Need this for Node < 15 +process.on("unhandledRejection", (err) => { + throw err; +}); + process.on("uncaughtException", (err) => { const fault = errorToFault(err); jobs.forEach((jobId) => { diff --git a/bin/genieacs-fs.ts b/bin/genieacs-fs.ts index c0d37f8..240ef4e 100755 --- a/bin/genieacs-fs.ts +++ b/bin/genieacs-fs.ts @@ -79,6 +79,11 @@ if (!cluster.worker) { timeout: 30000, }; + // Need this for Node < 15 + process.on("unhandledRejection", (err) => { + throw err; + }); + process.on("uncaughtException", (err) => { if ((err as NodeJS.ErrnoException).code === "ERR_IPC_DISCONNECTED") return; logger.error({ diff --git a/bin/genieacs-nbi.ts b/bin/genieacs-nbi.ts index ae7ede2..20e36bb 100755 --- a/bin/genieacs-nbi.ts +++ b/bin/genieacs-nbi.ts @@ -84,6 +84,11 @@ if (!cluster.worker) { timeout: 30000, }; + // Need this for Node < 15 + process.on("unhandledRejection", (err) => { + throw err; + }); + process.on("uncaughtException", (err) => { if ((err as NodeJS.ErrnoException).code === "ERR_IPC_DISCONNECTED") return; logger.error({ diff --git a/bin/genieacs-ui.ts b/bin/genieacs-ui.ts index 4ef9714..7cd93af 100755 --- a/bin/genieacs-ui.ts +++ b/bin/genieacs-ui.ts @@ -84,6 +84,11 @@ if (!cluster.worker) { timeout: 30000, }; + // Need this for Node < 15 + process.on("unhandledRejection", (err) => { + throw err; + }); + process.on("uncaughtException", (err) => { if ((err as NodeJS.ErrnoException).code === "ERR_IPC_DISCONNECTED") return; logger.error({