Skip to content

Commit 0a90671

Browse files
committed
Add debug except to block parsing
1 parent 6d548f7 commit 0a90671

File tree

1 file changed

+6
-0
lines changed
  • src/sphinx_codeautolink/extension

1 file changed

+6
-0
lines changed

src/sphinx_codeautolink/extension/block.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,12 @@ def parse_source( # noqa: C901
258258
msg = self._parsing_error_msg(e, language, show_source)
259259
logger.warning(msg, type=warn_type, subtype="parse_block", location=node)
260260
return
261+
except Exception as e:
262+
show_source = self._format_source_for_error(
263+
self.global_preface, self.concat_sources, prefaces, transform.source
264+
)
265+
msg = self._parsing_error_msg(e, language, show_source)
266+
raise type(e)(msg) from e
261267

262268
if prefaces or self.concat_sources or self.global_preface:
263269
concat_lens = [s.count("\n") + 1 for s in self.concat_sources]

0 commit comments

Comments
 (0)