From ab9892b87be2f457d28e98ca6df5cedba861cffd Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Fri, 15 Jun 2001 03:59:58 +0000 Subject: [PATCH] Checking for write errors svn: r140 --- gramps/src/gramps_main.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gramps/src/gramps_main.py b/gramps/src/gramps_main.py index 85a294942..f990cb69f 100755 --- a/gramps/src/gramps_main.py +++ b/gramps/src/gramps_main.py @@ -816,7 +816,18 @@ def save_file(filename): old_file = filename 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) utils.clearModified() Config.save_last_file(old_file)