#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 pass
class DbError(Exception): class DbError(Exception):
"""Error used to report that the request window is already displayed.""" """Error used to report BerkeleyDB errors"""
def __init__(self, value): def __init__(self, value):
Exception.__init__(self) Exception.__init__(self)
if isinstance(value, tuple): try:
self.value = value[1] (errnum, errmsg) = value
else: self.value = errmsg
except:
self.value = value self.value = value
def __str__(self): def __str__(self):