diff options
| author | Daniel Pettersson <daniel@dpettersson.net> | 2026-04-26 22:00:24 +0200 |
|---|---|---|
| committer | Daniel Pettersson <daniel@dpettersson.net> | 2026-04-26 22:00:24 +0200 |
| commit | 62e2fc9e0c8a3dd47fd1a7d875c10fbde7fa4e7a (patch) | |
| tree | e3c942ad8bdd3b57f45e9be2d391272b3aea70c0 | |
| parent | dc9e8757bf79a1f5f1fa2c11574f8f93b5644d4b (diff) | |
Improve shutdown timer-drain error handling
As suggested by Stefan Monnier, use `with-demote-errors' instead of
`ignore-errors' so swallowed errors are at least logged. Add XXX
comment explaining the undesirable behavior.
| -rw-r--r-- | dape.el | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -2639,12 +2639,15 @@ SKIP-COMPILE is used internally for recursive calls." (defun dape--shutdown (conn) "Shutdown CONN and delete its jsonrpc buffers." - ;; Signal the process first so the sentinel fires as iter 0 in + ;; Signal the process first so the sentinel fires on iter 0 in ;; `jsonrpc-shutdown'. Preventing the misleading sentinel warning ;; (DAP has no client-initiated shutdown). (unwind-protect (let ((proc (jsonrpc--process conn))) - (ignore-errors (accept-process-output nil 0.2)) ; pump timers before deleting + ;; XXX Final call for timers to run while process exists. + ;; May also swallow signals from non Dape owned + ;; timer/sentinel/filter functions. + (with-demote-errors "%S" (accept-process-output nil 0.2)) (delete-process proc) (jsonrpc-shutdown conn t)) (unless dape-debug |
