[postprocessor:exec] add a better error message (#155)

pull/170/head
Mike Fährmann 6 years ago
parent 89df37a173
commit 5f38ac9609
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -330,7 +330,7 @@ class DownloadJob(Job):
pp_obj = pp_cls(self.pathfmt, pp_dict)
except Exception as exc:
postprocessor.log.error(
"%s: initialization failed: %s %s",
"'%s' initialization failed: %s: %s",
name, exc.__class__.__name__, exc)
else:
self.postprocessors.append(pp_obj)

@ -16,7 +16,13 @@ class ExecPP(PostProcessor):
def __init__(self, pathfmt, options):
PostProcessor.__init__(self)
self.args = options["command"]
try:
self.args = options["command"]
self.args[0] # test if 'args' is subscriptable
except (KeyError, IndexError, TypeError):
raise TypeError("option 'command' must be a non-empty list")
if options.get("async", False):
self._exec = subprocess.Popen

Loading…
Cancel
Save