Skip to content
Snippets Groups Projects
Commit d3aab505 authored by Sybren A. Stüvel's avatar Sybren A. Stüvel
Browse files

Better logging when a command fails

parent 252af665
Branches
Tags
No related merge requests found
...@@ -506,10 +506,12 @@ class AbstractSubprocessCommand(AbstractCommand): ...@@ -506,10 +506,12 @@ class AbstractSubprocessCommand(AbstractCommand):
await self.worker.register_log(processed_line) await self.worker.register_log(processed_line)
retcode = await self.proc.wait() retcode = await self.proc.wait()
self._log.info('Command %r (pid=%d) stopped with status code %s', args, pid, retcode) cmdline = ' '.join(shlex.quote(arg) for arg in args)
self._log.info('Command %r (pid=%d) stopped with status code %s', cmdline, pid, retcode)
if retcode: if retcode:
raise CommandExecutionError('Command pid=%d failed with status %s' % (pid, retcode)) raise CommandExecutionError('Command %r (pid=%d) failed with status %s' %
(cmdline, pid, retcode))
except asyncio.CancelledError: except asyncio.CancelledError:
self._log.info('asyncio task got canceled, killing subprocess pid=%d', pid) self._log.info('asyncio task got canceled, killing subprocess pid=%d', pid)
await self.abort() await self.abort()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment