6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-12-12 14:17:46 +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.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))