@forklaunch/core 0.9.2 → 0.9.4

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,25 @@ 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", {
1388
+ err
1389
+ });
1390
+ process.exit(1);
1391
+ });
1392
+ process.on("unhandledRejection", (reason) => {
1393
+ this.openTelemetryCollector.log("error", "Unhandled rejection", {
1394
+ reason
1395
+ });
1396
+ process.exit(1);
1397
+ });
1398
+ process.on("exit", () => {
1399
+ this.openTelemetryCollector.log("info", "Shutting down application");
1400
+ });
1401
+ process.on("SIGINT", () => {
1402
+ this.openTelemetryCollector.log("info", "Shutting down application");
1403
+ process.exit(0);
1404
+ });
1386
1405
  this.internal.use(createContext(this.schemaValidator));
1387
1406
  this.internal.use(cors(this.appOptions?.cors ?? {}));
1388
1407
  }