From 8087c0e6439c883a1a36e864f418a1d9786425da Mon Sep 17 00:00:00 2001 From: mhagger Date: Sun, 18 Nov 2007 20:53:40 +0000 Subject: [PATCH] Improve the error message for RCSExpected exceptions. * lib/vclib/ccvs/rcsparse/common.py (RCSExpected.__init__): Improve the error message passed to the base class constructor. Also improve spacing around the exception class definitions. git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1723 8cb11bc2-c004-0410-86c3-e597b4017df7 --- lib/vclib/ccvs/rcsparse/common.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/vclib/ccvs/rcsparse/common.py b/lib/vclib/ccvs/rcsparse/common.py index 27986d90..7285146e 100644 --- a/lib/vclib/ccvs/rcsparse/common.py +++ b/lib/vclib/ccvs/rcsparse/common.py @@ -72,16 +72,26 @@ class Sink: class RCSParseError(Exception): pass + + class RCSIllegalCharacter(RCSParseError): pass -### need more work on this one + + class RCSExpected(RCSParseError): def __init__(self, got, wanted): - RCSParseError.__init__(self, got, wanted) + RCSParseError.__init__( + self, + 'Unexpected parsing error in RCS file.\n' + 'Expected token: %s, but saw: %s' + % (wanted, got) + ) + class RCSStopParser(Exception): pass + # -------------------------------------------------------------------------- # # STANDARD TOKEN STREAM-BASED PARSER