@memberjunction/server 3.1.0 → 3.2.0

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.
package/src/index.ts CHANGED
@@ -406,4 +406,12 @@ export const serve = async (resolverPaths: Array<string>, app: Application = cre
406
406
 
407
407
  process.on('SIGTERM', () => gracefulShutdown('SIGTERM'));
408
408
  process.on('SIGINT', () => gracefulShutdown('SIGINT'));
409
+
410
+ // Handle unhandled promise rejections to prevent server crashes
411
+ process.on('unhandledRejection', (reason, promise) => {
412
+ console.error('❌ Unhandled Promise Rejection:', reason);
413
+ console.error(' Promise:', promise);
414
+ // Log the error but DO NOT crash the server
415
+ // This is critical for server stability when downstream dependencies fail
416
+ });
409
417
  };