Best-effort synchronous stderr write that can never keep a doomed process alive.
(line: string)
| 55 | |
| 56 | /** Best-effort synchronous stderr write that can never keep a doomed process alive. */ |
| 57 | function writeStderr(line: string): void { |
| 58 | try { |
| 59 | fs.writeSync(2, line); |
| 60 | } catch { |
| 61 | /* stderr closed/gone — nothing more we can safely do */ |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | /** Injectable seams so the wiring is testable without registering real handlers. */ |
| 66 | export interface FatalHandlerDeps { |
nothing calls this directly
no outgoing calls
no test coverage detected