summaryrefslogtreecommitdiff
path: root/portato
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2010-04-13 21:21:56 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2010-04-13 21:21:56 +0200
commit8af4942857cb8eb906056df4c4ae7ffefe9e229c (patch)
tree1de57da41a84c5e9d2dd9e4b409563a832550132 /portato
parent673edfd36e1d02a629838d3a408155779af50912 (diff)
downloadportato-8af4942857cb8eb906056df4c4ae7ffefe9e229c.tar.gz
portato-8af4942857cb8eb906056df4c4ae7ffefe9e229c.tar.bz2
portato-8af4942857cb8eb906056df4c4ae7ffefe9e229c.zip
Better eix error inheritance and handling
Diffstat (limited to 'portato')
-rw-r--r--portato/eix/exceptions.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/portato/eix/exceptions.py b/portato/eix/exceptions.py
index 1ca05e1..cc4665d 100644
--- a/portato/eix/exceptions.py
+++ b/portato/eix/exceptions.py
@@ -23,7 +23,14 @@ class EixError (Exception):
:ivar message: The error message
"""
+
message = _("Unknown error.")
+
+ def __init__ (self, msg = None):
+ Exception.__init__(self)
+
+ if msg:
+ self.message = msg
def __str__ (self):
return self.message
@@ -34,7 +41,7 @@ class EndOfFileException (EixError):
"""
def __init__ (self, filename):
- self.message = _("End of file reached though it was not expected: '%s'") % filename
+ EixError.__init__(self, _("End of file reached though it was not expected: '%s'") % filename)
class UnsupportedVersionError (EixError):
"""
@@ -42,4 +49,4 @@ class UnsupportedVersionError (EixError):
"""
def __init__ (self, version):
- self.message = _("Version '%s' is not supported.") % version
+ EixError.__init__(self, _("Version '%s' is not supported.") % version)