X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fdak_exceptions.py;h=b52e0657f6285629f9b540cd72908335de1989b6;hb=19d2c81f6fd652b12ac001cdef457dd42a12c998;hp=e9ab2c720c8b3501d843f1b1d109e89ea2264d5d;hpb=f86fb53a967d9fa0e92f3534b9a44a5ba0e6adb0;p=dak.git diff --git a/daklib/dak_exceptions.py b/daklib/dak_exceptions.py index e9ab2c72..b52e0657 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'] @@ -41,13 +44,13 @@ dakerrors = { "UnknownFormatError": """Exception raised for unknown Format: lines in changes files.""", "NoFilesFieldError": """Exception raised for missing files field in dsc/changes.""", "CantOpenError": """Exception raised when files can't be opened.""", - "CantOverwriteError": """Exception raised when files cant be overwritten.""", + "CantOverwriteError": """Exception raised when files can't be overwritten.""", "FileExistsError": """Exception raised when destination file exists.""", "SendmailFailedError": """Exception raised when Sendmail invocation failed.""", - "NoFreeFilenameError": """Exception raised when no alternate filename was found.""" + "NoFreeFilenameError": """Exception raised when no alternate filename was found.""", + "TransitionsError": """Exception raised when transitions file can't be parsed.""" } - def construct_dak_exception(name, description): class Er(DakError): __doc__ = description