emacs-async
emacs-async copied to clipboard
finish-func not called when process exits non-zero
trafficstars
Hi John,
Maybe I'm doing something wrong, but this doesn't seem right to me, and I can't find it documented anywhere (the lexical-let is because I ran that in *scratch*):
(progn
(setq argh (async-start-process "ag-scan-async" "nice"
(lexical-let ((start (format-time-string "%F %T")))
(lambda (process)
(message "STATUS: %s STARTED AT: %s CALLED AT: %s" (process-exit-status process)
start (format-time-string "%F %T"))))
"-n5"
"timeout" "3"
"sleep" "10"))
(sleep-for 4)
(list :ready (async-ready argh)
:exit (process-exit-status argh)))
This sleeps for 4 seconds and returns:
(:ready t :exit 124)
However, message is never called. Then when I run:
(async-get argh)
I get:
(error "Async process 'ag-scan-async' failed with exit code 124")
This is inconvenient, because I'm trying to use timeout to prevent a process from running for too long, and I'd like to raise an error when it times out, but since the finish-func doesn't get called until I manually do async-get, I would have to run my own timer outside of async-start-process to catch it.
Thanks.