mirror of
https://github.com/beetbox/beets.git
synced 2025-12-25 18:13:17 +01:00
friendly error message in Item.write (GC-437)
This commit is contained in:
parent
ef248576f0
commit
c056467c5d
3 changed files with 9 additions and 2 deletions
|
|
@ -23,6 +23,7 @@ import shlex
|
|||
import unicodedata
|
||||
import threading
|
||||
import contextlib
|
||||
import traceback
|
||||
from collections import defaultdict
|
||||
from unidecode import unidecode
|
||||
from beets.mediafile import MediaFile
|
||||
|
|
@ -283,7 +284,12 @@ class Item(object):
|
|||
f = MediaFile(syspath(self.path))
|
||||
for key in ITEM_KEYS_WRITABLE:
|
||||
setattr(f, key, getattr(self, key))
|
||||
f.save()
|
||||
|
||||
try:
|
||||
f.save()
|
||||
except (OSError, IOError) as exc:
|
||||
raise util.FilesystemError(exc, 'write', (self.path,),
|
||||
traceback.format_exc())
|
||||
|
||||
# The file has a new mtime.
|
||||
self.mtime = self.current_mtime()
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class FilesystemError(HumanReadableException):
|
|||
clause = 'while {0} {1} to {2}'.format(
|
||||
self._gerund(), repr(self.paths[0]), repr(self.paths[1])
|
||||
)
|
||||
elif self.verb in ('delete',):
|
||||
elif self.verb in ('delete', 'write'):
|
||||
clause = 'while {0} {1}'.format(
|
||||
self._gerund(), repr(self.paths[0])
|
||||
)
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ Changelog
|
|||
modify files' tags even when they successfully change the database.
|
||||
* Fix a VFS bug leading to a crash in the :doc:`/plugins/bpd` when files had
|
||||
non-ASCII extensions.
|
||||
* Add a human-readable error message when writing files' tags fails.
|
||||
|
||||
.. _Tomahawk resolver: http://beets.radbox.org/blog/tomahawk-resolver.html
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue