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
remotes/options-overhaul
mhagger 2007-11-18 20:53:40 +00:00
parent 4c04da27da
commit 8087c0e643
1 changed files with 12 additions and 2 deletions

View File

@ -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