#2483 DbError handling correction - patch Josip

svn: r11341
This commit is contained in:
Benny Malengier 2008-11-24 09:02:02 +00:00
parent 2a33e32456
commit 44c8b26f10

View File

@ -140,12 +140,13 @@ class ValidationError(Exception):
pass
class DbError(Exception):
"""Error used to report that the request window is already displayed."""
"""Error used to report BerkeleyDB errors"""
def __init__(self, value):
Exception.__init__(self)
if isinstance(value, tuple):
self.value = value[1]
else:
try:
(errnum, errmsg) = value
self.value = errmsg
except:
self.value = value
def __str__(self):