Skip to content
Permalink
Browse files

catches an exception and provides more information

  • Loading branch information...
sdpython committed Sep 4, 2016
1 parent 33e4641 commit d66c2a424c4c289e75746b5b6ea382962df42d00
Showing with 9 additions and 5 deletions.
  1. +9 −5 src/pyquickhelper/sphinxext/sphinx_mathdef_extension.py
@@ -49,11 +49,11 @@ class MathDef(BaseAdmonition):
Example::
.. mathdef::
:title: title
:tag: definition or theorem or ...
:lid: id (used for further reference)
:title: title
:tag: definition or theorem or ...
:lid: id (used for further reference)
Description of the math
Description of the math
"""

node_class = mathdef_node
@@ -139,7 +139,11 @@ def run(self):
env.new_serialno('indexmathe%s' % mathtag))
ids = [targetid]
targetnode = nodes.target(legend, '', ids=ids[0])
self.state.add_target(targetid, '', targetnode, lineno)
try:
self.state.add_target(targetid, '', targetnode, lineno)
except Exception as e:
raise Exception("Issue in\n File '{0}', line {1}\ntid={2}\ntnode={3}".format(
None if env is None else env.docname, lineno, targetid, targetnode)) from e

# index node
index = self.options.get('index', None)

0 comments on commit d66c2a4

Please sign in to comment.
You can’t perform that action at this time.