diff options
author | Xiyue Deng <manphiz@gmail.com> | 2023-09-16 23:08:56 -0700 |
---|---|---|
committer | Xiyue Deng <manphiz@gmail.com> | 2023-10-04 01:15:16 -0700 |
commit | 07c03e0c12c2ae8765dcbb73c31ad609474e1943 (patch) | |
tree | 5fcfd72a816f61ee8aa6b32fff1afaca7161145d /debian-bug.el | |
parent | 284c085ff4cd8e7e0b575653bacaf40f22c413fc (diff) |
Handle process error more gracefully.
* If the bug script process fails, don't try to set process sentinel but print a
warning of potentially missing info from bug script.
Diffstat (limited to 'debian-bug.el')
-rw-r--r-- | debian-bug.el | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/debian-bug.el b/debian-bug.el index c4a65b4..ea6ea3f 100644 --- a/debian-bug.el +++ b/debian-bug.el @@ -903,20 +903,25 @@ reporting process by calling `debian-bug-compose-report'." ;; process sentinel with the required data on the fly. ;; However, I suspect there are better ways to do this, ;; perhaps to use lexical-let. - (set-process-sentinel - bug-script-process - (list 'lambda '(process event) - (list 'debian-bug-script-sentinel 'process 'event - package severity subject filename - bug-script-temp-file - (current-window-configuration)))) - - (term-char-mode) - - ;; The function set-process-query-on-exit-flag is only - ;; available in GNU Emacs version 22 and later. - (if (fboundp 'set-process-query-on-exit-flag) - (set-process-query-on-exit-flag bug-script-process nil))) + (if bug-script-process + (progn + (set-process-sentinel + bug-script-process + (list 'lambda '(process event) + (list 'debian-bug-script-sentinel 'process 'event + package severity subject filename + bug-script-temp-file + (current-window-configuration)))) + + (term-char-mode) + + ;; The function set-process-query-on-exit-flag is only + ;; available in GNU Emacs version 22 and later. + (if (fboundp 'set-process-query-on-exit-flag) + (set-process-query-on-exit-flag bug-script-process + nil))) + (message "Trying to get package related info failed. Generated " + "bug report may be missing some information."))) ;; Delay switching to the process output buffer by waiting ;; for output from the process, the process to terminate or |