diff options
author | Dieter Verfaillie <dieterv@optionexplicit.be> | 2013-01-09 22:45:40 +0100 |
---|---|---|
committer | Dieter Verfaillie <dieterv@optionexplicit.be> | 2013-01-09 22:45:40 +0100 |
commit | fbe0966625757266040d1a9831d27f78bd00d753 (patch) | |
tree | 463759800c380f0e34af0044d1553f82bf538e64 /giscanner/annotationparser.py | |
parent | a6c564c0fc9262ae85a6cffd44e4134ed91e610a (diff) | |
download | gobject-introspection-fbe0966625757266040d1a9831d27f78bd00d753.tar.gz |
giscanner: emit a warning when we fail to parse a GTK-Doc comment block
Instead of going down with a for the user inexplicable backtrace,
emit a warning asking said user to file a bug including the
comment block in question.
Thanks to Alexandre Rostovtsev <tetromino@gentoo.org> for
proposing something similar in bug #690850
https://bugzilla.gnome.org/show_bug.cgi?id=690850
Diffstat (limited to 'giscanner/annotationparser.py')
-rw-r--r-- | giscanner/annotationparser.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py index d4b24992..9c0ce5a4 100644 --- a/giscanner/annotationparser.py +++ b/giscanner/annotationparser.py @@ -766,7 +766,13 @@ class AnnotationParser(object): comment_blocks = {} for comment in comments: - comment_block = self.parse_comment_block(comment) + try: + comment_block = self.parse_comment_block(comment) + except Exception: + message.warn('unrecoverable parse error, please file a GObject-Introspection ' + 'bug report including the complete comment block at the ' + 'indicated location.', message.Position(comment[1], comment[2])) + continue if comment_block is not None: # Note: previous versions of this parser did not check |