From d978401155a73ec15d214616faf7b725aa6f857f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Fri, 30 Oct 2020 18:16:54 +0100 Subject: [PATCH] Better error management in execute internal function --- tutor/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tutor/utils.py b/tutor/utils.py index 4d377cf..1030a45 100644 --- a/tutor/utils.py +++ b/tutor/utils.py @@ -172,10 +172,12 @@ def execute(*command): p.kill() p.wait() raise - except Exception: + except Exception as e: p.kill() p.wait() - raise exceptions.TutorError("Command failed: {}".format(" ".join(command))) + raise exceptions.TutorError( + "Command failed: {}".format(" ".join(command)) + ) from e if result > 0: raise exceptions.TutorError( "Command failed with status {}: {}".format(result, " ".join(command))