From fa8c93ad9a6ccd210324951d999adab3766bdf63 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Wed, 9 Feb 2022 10:01:36 +0100 Subject: [PATCH] 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. --- src/process.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)) { -- 2.39.5