[postprocessor:exec] add a better error message (#155)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user