@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.
@@ -1319,6 +1319,23 @@ var ForklaunchExpressLikeApplication = class extends ForklaunchExpressLikeRouter
1319
1319
  this.postEnrichMiddleware = postEnrichMiddleware;
1320
1320
  this.openTelemetryCollector = openTelemetryCollector;
1321
1321
  this.appOptions = appOptions;
1322
+ process.on("uncaughtException", (err) => {
1323
+ this.openTelemetryCollector.log("error", "Uncaught exception", { err });
1324
+ process.exit(1);
1325
+ });
1326
+ process.on("unhandledRejection", (reason) => {
1327
+ this.openTelemetryCollector.log("error", "Unhandled rejection", {
1328
+ reason
1329
+ });
1330
+ process.exit(1);
1331
+ });
1332
+ process.on("exit", () => {
1333
+ this.openTelemetryCollector.log("info", "Shutting down application");
1334
+ });
1335
+ process.on("SIGINT", () => {
1336
+ this.openTelemetryCollector.log("info", "Shutting down application");
1337
+ process.exit(0);
1338
+ });
1322
1339
  this.internal.use(createContext(this.schemaValidator));
1323
1340
  this.internal.use(cors(this.appOptions?.cors ?? {}));
1324
1341
  }