From: Robert Pluim Date: Wed, 9 Feb 2022 09:01:36 +0000 (+0100) Subject: Improve error message for 'not running' processes X-Git-Tag: emacs-29.0.90~1931^2~1094 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fa8c93ad9a6ccd210324951d999adab3766bdf63;p=emacs.git Improve error message for 'not running' processes The current error message is simply 'not running', but 'status_message' can give information about why the process is in that state, such as network errors, so return that as well. (Bug#53762) * src/process.c (send_process, Fprocess_send_eof): Add the output of 'status_message' to the error string. --- diff --git a/src/process.c b/src/process.c index 94cc8800970..993e1c56038 100644 --- a/src/process.c +++ b/src/process.c @@ -6420,7 +6420,7 @@ send_process (Lisp_Object proc, const char *buf, ptrdiff_t len, if (p->raw_status_new) update_status (p); if (! EQ (p->status, Qrun)) - error ("Process %s not running", SDATA (p->name)); + error ("Process %s not running: %s", SDATA (p->name), SDATA (status_message (p))); if (p->outfd < 0) error ("Output file descriptor of %s is closed", SDATA (p->name)); @@ -7125,7 +7125,7 @@ process has been transmitted to the serial port. */) if (XPROCESS (proc)->raw_status_new) update_status (XPROCESS (proc)); if (! EQ (XPROCESS (proc)->status, Qrun)) - error ("Process %s not running", SDATA (XPROCESS (proc)->name)); + error ("Process %s not running: %s", SDATA (XPROCESS (proc)->name), SDATA (status_message (XPROCESS (proc)))); if (coding && CODING_REQUIRE_FLUSHING (coding)) {