From: Mark Hymers Date: Mon, 5 May 2008 13:54:03 +0000 (+0100) Subject: * daklib/dak_exceptions.py: Add a default message and tidy up our string X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e58b52c00c1a795054d48bbead5aedc5364bfec3;p=dak * daklib/dak_exceptions.py: Add a default message and tidy up our string representation --- diff --git a/ChangeLog b/ChangeLog index 76d6a4bb..869ff621 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-05 Mark Hymers + + * daklib/dak_exceptions.py: Add a default message and tidy up our string + representation + 2008-05-05 Joerg Jaspert * daklib/dak_exceptions.py: New file, central place for all those diff --git a/daklib/dak_exceptions.py b/daklib/dak_exceptions.py index e9ab2c72..e488ac9d 100644 --- a/daklib/dak_exceptions.py +++ b/daklib/dak_exceptions.py @@ -28,9 +28,12 @@ class DakError(Exception): message -- explanation of the error """ - def __init__(self, message): - self.args = message - self.message = message + def __init__(self, message=""): + self.args = str(message) + self.message = str(message) + + def __str__(self): + return self.message __all__ = ['DakError']