From 44c8b26f10bb09654d084c8932ddaec78048269a Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Mon, 24 Nov 2008 09:02:02 +0000 Subject: [PATCH] #2483 DbError handling correction - patch Josip svn: r11341 --- src/Errors.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Errors.py b/src/Errors.py index f02932900..fa84e2b6b 100644 --- a/src/Errors.py +++ b/src/Errors.py @@ -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):