From ed78f926c3495b0c89ccaf103dcc4be50be6395f Mon Sep 17 00:00:00 2001 From: Pol Van Aubel Date: Mon, 28 Oct 2019 20:58:49 +0100 Subject: Be more informative if editor exits with error. Implements the suggestion in #1427 to display the actual error code, and substitutes an empty stderr with "No stderr output". --- alot/commands/globals.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'alot/commands/globals.py') diff --git a/alot/commands/globals.py b/alot/commands/globals.py index c61015f9..05ab6427 100644 --- a/alot/commands/globals.py +++ b/alot/commands/globals.py @@ -304,7 +304,10 @@ class ExternalCommand(Command): if self.on_success is not None: self.on_success() else: - ui.notify(ret, priority='error') + msg = "editor has exited with error code {} -- {}".format( + proc.returncode, + ret or "No stderr output") + ui.notify(msg, priority='error') if self.refocus and callerbuffer in ui.buffers: logging.info('refocussing') ui.buffer_focus(callerbuffer) -- cgit v1.2.3