mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Nicer error message when reanming a library fails
This commit is contained in:
parent
de298693ee
commit
d9514e394e
@ -177,7 +177,16 @@ class ChooseLibraryAction(InterfaceAction):
|
||||
return error_dialog(self.gui, _('Already exists'),
|
||||
_('The folder %s already exists. Delete it first.') %
|
||||
newloc, show=True)
|
||||
os.rename(loc, newloc)
|
||||
try:
|
||||
os.rename(loc, newloc)
|
||||
except:
|
||||
import traceback
|
||||
error_dialog(self.gui, _('Rename failed'),
|
||||
_('Failed to rename the library at %s. '
|
||||
'The most common cause for this is if one of the files'
|
||||
' in the library is open in another program.') % loc,
|
||||
det_msg=traceback.format_exc(), show=True)
|
||||
return
|
||||
self.stats.rename(location, newloc)
|
||||
self.build_menus()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user