# HG changeset patch # User Paul Crowley # Date 1204628539 0 # Node ID c0be990fe8a88b00630c1656d0029fe60ea48b02 # Parent 9461f5c3a67cad02ef376902ce842141561d9be6 fix exception reporting diff -r 9461f5c3a67c -r c0be990fe8a8 fastimport/errors.py --- 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"