Repository navigation
Commit 0e0d21e
Handle errors when deleting dev-mode PID file on exit
The `onExited` listener in `writePidIfInDevMode` is `async`, but VS Code
`Event` listeners are fire-and-forget: the returned promise is never
awaited. As Copilot noted on #5515, that means a rejection from
`fs.delete(...)` would surface as an unhandled promise rejection, and the
debug log would be skipped on failure.
I kept the `async`/`await` form for readability and wrapped the body in
`try`/`catch` so nothing escapes: a fully-caught async body resolves
normally, and any failure is now logged via `this.logger.writeError`
instead of going unhandled. The original `main` version floated the
delete promise and logged success unconditionally, swallowing errors.
Drafted by Copilot (Claude Opus 4.8).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 21fae13 commit 0e0d21e
1 file changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
390 | | - | |
391 | | - | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
392 | 398 | | |
393 | 399 | | |
394 | 400 | | |
| |||
0 commit comments