@forklaunch/core 0.15.9 → 0.15.11

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.
@@ -1114,7 +1114,7 @@ var ForklaunchExpressLikeRouter = class _ForklaunchExpressLikeRouter {
1114
1114
  this.postEnrichMiddleware = postEnrichMiddleware;
1115
1115
  this.openTelemetryCollector = openTelemetryCollector;
1116
1116
  this.routerOptions = routerOptions;
1117
- if (process.env.NODE_ENV !== "test" && !process.env.VITEST) {
1117
+ if (process.env.NODE_ENV !== "test" && !process.env.VITEST && process.env.FORKLAUNCH_MODE !== "openapi") {
1118
1118
  process.on("uncaughtException", (err) => {
1119
1119
  this.openTelemetryCollector.error(`Uncaught exception: ${err}`);
1120
1120
  process.exit(1);
@@ -3525,11 +3525,18 @@ ${res.locals.errorMessage}`;
3525
3525
  originalSend.call(instance, errorString);
3526
3526
  errorSent = true;
3527
3527
  callback(new Error(errorString));
3528
+ } else {
3529
+ let data2 = "";
3530
+ for (const [key, value] of Object.entries(chunk)) {
3531
+ data2 += `${key}: ${typeof value === "string" ? value : safeStringify4(value)}
3532
+ `;
3533
+ }
3534
+ data2 += "\n";
3535
+ callback(null, data2);
3528
3536
  }
3529
3537
  });
3530
3538
  firstPass = false;
3531
- }
3532
- if (!errorSent) {
3539
+ } else if (!errorSent) {
3533
3540
  let data2 = "";
3534
3541
  for (const [key, value] of Object.entries(chunk)) {
3535
3542
  data2 += `${key}: ${typeof value === "string" ? value : safeStringify4(value)}
@@ -3590,17 +3597,16 @@ ${res.locals.errorMessage}`;
3590
3597
  res.status(500);
3591
3598
  originalSend.call(instance, errorString);
3592
3599
  errorSent = true;
3600
+ } else {
3601
+ if (typeof data === "string") {
3602
+ res.type("text/plain");
3603
+ originalSend.call(instance, data);
3604
+ } else if (!(data instanceof File)) {
3605
+ res.sent = true;
3606
+ originalOperation.call(instance, data);
3607
+ }
3593
3608
  }
3594
3609
  });
3595
- if (!errorSent) {
3596
- if (typeof data === "string") {
3597
- res.type("text/plain");
3598
- originalSend.call(instance, data);
3599
- } else if (!(data instanceof File)) {
3600
- res.sent = true;
3601
- originalOperation.call(instance, data);
3602
- }
3603
- }
3604
3610
  }
3605
3611
  if (shouldEnrich) {
3606
3612
  recordMetric(req, res);