6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-09-27 19:59:02 +00:00

Better error management in execute internal function

This commit is contained in:
Régis Behmo 2020-10-30 18:16:54 +01:00
parent 8d4bb1fc9e
commit d978401155

View File

@ -172,10 +172,12 @@ def execute(*command):
p.kill() p.kill()
p.wait() p.wait()
raise raise
except Exception: except Exception as e:
p.kill() p.kill()
p.wait() p.wait()
raise exceptions.TutorError("Command failed: {}".format(" ".join(command))) raise exceptions.TutorError(
"Command failed: {}".format(" ".join(command))
) from e
if result > 0: if result > 0:
raise exceptions.TutorError( raise exceptions.TutorError(
"Command failed with status {}: {}".format(result, " ".join(command)) "Command failed with status {}: {}".format(result, " ".join(command))