Checking for write errors
svn: r140
This commit is contained in:
parent
e370bcbf4d
commit
ab9892b87b
@ -816,7 +816,18 @@ def save_file(filename):
|
|||||||
|
|
||||||
old_file = filename
|
old_file = filename
|
||||||
filename = filename + os.sep + const.indexFile
|
filename = filename + os.sep + const.indexFile
|
||||||
WriteXML.exportData(database,filename,load_progress)
|
try:
|
||||||
|
WriteXML.exportData(database,filename,load_progress)
|
||||||
|
except IOError, msg:
|
||||||
|
GnomeErrorDialog(_("Could not create %s") % filename + "\n" + str(msg))
|
||||||
|
return
|
||||||
|
except OSError, msg:
|
||||||
|
GnomeErrorDialog(_("Could not create %s") % filename + "\n" + str(msg))
|
||||||
|
return
|
||||||
|
except:
|
||||||
|
GnomeErrorDialog(_("Could not create %s") % filename)
|
||||||
|
return
|
||||||
|
|
||||||
database.setSavePath(old_file)
|
database.setSavePath(old_file)
|
||||||
utils.clearModified()
|
utils.clearModified()
|
||||||
Config.save_last_file(old_file)
|
Config.save_last_file(old_file)
|
||||||
|
Loading…
Reference in New Issue
Block a user