mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-12 19:57:17 +00:00
Improve CommandEventHandler subprocess failure error message
This commit is contained in:
parent
1617761184
commit
94dee63a41
@ -129,7 +129,7 @@ class CommandEventHandler(PipeIOEventHandler):
|
|||||||
return_code = self._proc.wait()
|
return_code = self._proc.wait()
|
||||||
if return_code != 0:
|
if return_code != 0:
|
||||||
_, stderr = self._proc.communicate()
|
_, stderr = self._proc.communicate()
|
||||||
raise RuntimeError(f'Subprocess failed: {stderr.decode()}')
|
raise RuntimeError(f'Subprocess failed ({return_code})! Stderr:\n{stderr.decode()}')
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
with suppress(ProcessLookupError):
|
with suppress(ProcessLookupError):
|
||||||
|
Loading…
Reference in New Issue
Block a user