mirror of
https://github.com/beetbox/beets.git
synced 2026-01-05 07:23:33 +01:00
badfiles: Better logging and error handling (#2428)
This commit is contained in:
parent
c09a3379cf
commit
0131ce263d
1 changed files with 5 additions and 3 deletions
|
|
@ -44,10 +44,11 @@ class BadFiles(BeetsPlugin):
|
|||
status = e.returncode
|
||||
except OSError as e:
|
||||
if e.errno == errno.ENOENT:
|
||||
ui.print_(u"command not found: {}".format(cmd[0]))
|
||||
sys.exit(1)
|
||||
raise ui.UserError(u"command not found: {}".format(cmd[0]))
|
||||
else:
|
||||
raise
|
||||
raise ui.UserError(
|
||||
u"error invoking {}: {}".format(cmd[0], e)
|
||||
)
|
||||
output = output.decode(sys.getfilesystemencoding())
|
||||
return status, errors, [line for line in output.split("\n") if line]
|
||||
|
||||
|
|
@ -96,6 +97,7 @@ class BadFiles(BeetsPlugin):
|
|||
ext = os.path.splitext(item.path)[1][1:]
|
||||
checker = self.get_checker(ext)
|
||||
if not checker:
|
||||
self._log.debug(u"no checker available for {}", ext)
|
||||
continue
|
||||
path = item.path
|
||||
if not isinstance(path, six.text_type):
|
||||
|
|
|
|||
Loading…
Reference in a new issue