Skip to content

Commit

Permalink
DOC: extend check example error
Browse files Browse the repository at this point in the history
  • Loading branch information
SMoraisAnsys committed Feb 21, 2024
1 parent 5104e9e commit 88f6292
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,12 @@ def check_example_error(app, pagename, templatename, context, doctree):
"""
# Check if the HTML contains an error message
if pagename.startswith("examples") and not pagename.endswith("/index"):
if any(map(lambda msg: msg in context["body"], ["UsageError", "NameError"])):
if any(
map(
lambda msg: msg in context["body"],
["UsageError", "NameError", "DeadKernelError", "NotebookError"],
)
):
logger.error(f"An error was detected in file {pagename}")
app.builder.config.html_context["build_error"] = True

Expand Down

0 comments on commit 88f6292

Please sign in to comment.