()
| 18 | const devCrashGuard = (): Plugin => { |
| 19 | let installed = false; |
| 20 | const install = () => { |
| 21 | if (installed) return; |
| 22 | installed = true; |
| 23 | process.on("uncaughtException", (err, origin) => { |
| 24 | console.error(`[dev-crash-guard] uncaughtException (origin=${origin}):`, err); |
| 25 | }); |
| 26 | process.on("unhandledRejection", (reason, promise) => { |
| 27 | console.error("[dev-crash-guard] unhandledRejection:", reason, promise); |
| 28 | }); |
| 29 | }; |
| 30 | return { |
| 31 | name: "dev-crash-guard", |
| 32 | apply: "serve", |