Performance: Graceful shutdown on errors
HIGH IMPACT
This affects server responsiveness and resource cleanup during error conditions, impacting user experience and server stability.
process.on('uncaughtException', (err) => { console.error('Uncaught Exception:', err); server.close(() => { // cleanup resources here process.exit(1); }); });
process.on('uncaughtException', (err) => { console.error('Uncaught Exception:', err); // No shutdown or cleanup, server keeps running });
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| No graceful shutdown on error | N/A | N/A | N/A | [X] Bad |
| Graceful shutdown with cleanup | N/A | N/A | N/A | [OK] Good |