Switch to using check_call for hooks

This commit is contained in:
Jack Wilsdon 2019-10-16 21:52:39 +01:00 committed by Jack Wilsdon
parent 4d55e6dfbb
commit 430eab2cf0
No known key found for this signature in database
GPG key ID: 0D2BED7F97E2392C

View file

@ -105,7 +105,10 @@ class HookPlugin(BeetsPlugin):
u' '.join(command_pieces), event) u' '.join(command_pieces), event)
try: try:
subprocess.Popen(command_pieces).wait() subprocess.check_call(command_pieces)
except subprocess.CalledProcessError as exc:
self._log.error(u'hook for {0} exited with status {1}',
event, exc.returncode)
except OSError as exc: except OSError as exc:
self._log.error(u'hook for {0} failed: {1}', event, exc) self._log.error(u'hook for {0} failed: {1}', event, exc)