X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fdak_exceptions.py;h=e111afddb874c6a5a6cefcb01d0e950be6a7f027;hb=391f5ec09a119131dc846b796ca791f4cecc69e4;hp=b52e0657f6285629f9b540cd72908335de1989b6;hpb=813e459ceb4cdacc2498a2e2c2d51fc37437a53f;p=dak.git diff --git a/daklib/dak_exceptions.py b/daklib/dak_exceptions.py index b52e0657..e111afdd 100644 --- a/daklib/dak_exceptions.py +++ b/daklib/dak_exceptions.py @@ -1,8 +1,12 @@ -# Exception classes used in dak +#!/usr/bin/env python -# Copyright (C) 2008 Mark Hymers +""" +Exception classes used in dak -################################################################################ +@contact: Debian FTP Master +@copyright: 2008 Mark Hymers +@license: GNU General Public License version 2 or later +""" # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,17 +22,20 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -################################################################################ class DakError(Exception): - """Base class for all simple errors in this module. - - Attributes: + """ + Base class for all simple errors in this module. - message -- explanation of the error """ def __init__(self, message=""): + """ + @type message: string + @param message: explanation of the error + + """ + Exception.__init__(self) self.args = str(message) self.message = str(message) @@ -37,6 +44,7 @@ class DakError(Exception): __all__ = ['DakError'] +# If you want to have a new exception in dak, add it here. dakerrors = { "ParseMaintError": """Exception raised for errors in parsing a maintainer field.""", "ParseChangesError": """Exception raised for errors in parsing a changes file.""", @@ -48,8 +56,14 @@ dakerrors = { "FileExistsError": """Exception raised when destination file exists.""", "SendmailFailedError": """Exception raised when Sendmail invocation failed.""", "NoFreeFilenameError": """Exception raised when no alternate filename was found.""", - "TransitionsError": """Exception raised when transitions file can't be parsed.""" -} + "TransitionsError": """Exception raised when transitions file can't be parsed.""", + "NoSourceFieldError": """Exception raised - we cant find the source - wtf?""", + "MissingContents": """Exception raised - we could not determine contents for this deb""", + "DBUpdateError": """Exception raised - could not update the database""", + "ChangesUnicodeError": """Exception raised - changes file not properly utf-8 encoded""", + "AlreadyLockedError": """Exception raised - package already locked by someone else""", + "CantGetLockError": """Exception raised - lockfile already in use""", +} #: All dak exceptions def construct_dak_exception(name, description): class Er(DakError):