@forklaunch/core 0.8.8 → 0.8.9

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.
@@ -1383,6 +1383,23 @@ var ForklaunchExpressLikeApplication = class extends ForklaunchExpressLikeRouter
1383
1383
  this.postEnrichMiddleware = postEnrichMiddleware;
1384
1384
  this.openTelemetryCollector = openTelemetryCollector;
1385
1385
  this.appOptions = appOptions;
1386
+ process.on("uncaughtException", (err) => {
1387
+ this.openTelemetryCollector.log("error", "Uncaught exception", { err });
1388
+ process.exit(1);
1389
+ });
1390
+ process.on("unhandledRejection", (reason) => {
1391
+ this.openTelemetryCollector.log("error", "Unhandled rejection", {
1392
+ reason
1393
+ });
1394
+ process.exit(1);
1395
+ });
1396
+ process.on("exit", () => {
1397
+ this.openTelemetryCollector.log("info", "Shutting down application");
1398
+ });
1399
+ process.on("SIGINT", () => {
1400
+ this.openTelemetryCollector.log("info", "Shutting down application");
1401
+ process.exit(0);
1402
+ });
1386
1403
  this.internal.use(createContext(this.schemaValidator));
1387
1404
  this.internal.use(cors(this.appOptions?.cors ?? {}));
1388
1405
  }