changeset 2:c0be990fe8a8

fix exception reporting
author Paul Crowley <paul@lshift.net>
date Tue, 04 Mar 2008 11:02:19 +0000
parents 9461f5c3a67c
children 24c600e5cb71
files fastimport/errors.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/fastimport/errors.py	Fri Feb 29 17:58:31 2008 +0000
+++ b/fastimport/errors.py	Tue Mar 04 11:02:19 2008 +0000
@@ -22,8 +22,14 @@
 # Prefix to messages to show location information
 _LOCATION_FMT = "line %(lineno)d: "
 
+class FmtException(StandardError):
+    def __str__(self):
+        return repr(self)
 
-class ImportError(Exception):
+    def __repr__(self):
+        return self._fmt % self.__dict__
+
+class ImportError(FmtException):
     """The base exception class for all import processing exceptions."""
 
     _fmt = "Unknown Import Error"