From af6d0bc652948aa2bc7cecf4a16e316e025132e2 Mon Sep 17 00:00:00 2001 From: lethliel Date: Wed, 23 Oct 2019 14:12:03 +0200 Subject: [PATCH] osc ci improve error message on fail The error message if the call of _commit is just: "ERROR: service run failed" One option why this can fail is that the user Editor in env('EDITOR') is not present. We check now if e.msg gives a hint about "not found file" and then error out with a better error message --- osc/commandline.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osc/commandline.py b/osc/commandline.py index f4e23b51..8d0649a8 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -4773,6 +4773,11 @@ Please submit there instead, or use --nodevelproject to force direct submission. try: self._commit(subcmd, opts, args) except oscerr.ExtRuntimeError as e: + pattern = re.compile("No such file") + if "No such file" in e.msg: + editor = os.getenv('EDITOR', default=get_default_editor()) + print("Editor %s not found" % editor) + return 1 print("ERROR: service run failed", e, file=sys.stderr) return 1 except oscerr.PackageNotInstalled as e: