# HG changeset patch # User Paul Boddie # Date 1418081054 -3600 # Node ID f196c2c7ab3bebed1d8309bae41709005256b47e # Parent 3ae2bac023664c29af1992de649b759819d786d7 Raise a ParseError upon parsing ill-formed files. diff -r 3ae2bac02366 -r f196c2c7ab3b vContent.py --- a/vContent.py Mon Dec 08 22:45:33 2014 +0100 +++ b/vContent.py Tue Dec 09 00:24:14 2014 +0100 @@ -454,7 +454,10 @@ "Parse the contents of the file 'f'." ParserBase.parse(self, f, parser_cls) - return self.components[0] + try: + return self.components[0] + except IndexError: + raise ParseError, "No vContent component found in file." # Writer classes.