2006-07-14 Don Allingham <don@gramps-project.org>

* src/DbLoader.py (DbLoader.read_file): handle DBAccessError



svn: r7027
This commit is contained in:
Don Allingham 2006-07-15 03:56:13 +00:00
parent eff624fde1
commit 9a59537daf
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,6 @@
2006-07-14 Don Allingham <don@gramps-project.org>
* src/DbLoader.py (DbLoader.read_file): handle DBAccessError
2006-07-12 Brian Matherly <brian@gramps-project.org>
* src/ReportBase/_CommandLineReport.py: missing import - CustomFilters
* src/plugins/NarrativeWeb.py: HTML validation fixes

View File

@ -30,6 +30,7 @@ Handling of loading new/existing databases.
#
#-------------------------------------------------------------------------
import os
from bsddb.db import DBAccessError
from gettext import gettext as _
import logging
log = logging.getLogger(".")
@ -397,6 +398,10 @@ class DbLoader:
os.chdir(os.path.dirname(filename))
except:
print "could not change directory"
except DBAccessError, msg:
QuestionDialog.ErrorDialog(
_("Could not open file: %s") % filename,
str(msg[1]))
except Exception:
log.error("Failed to open database.", exc_info=True)