Skip to content

Commit

Permalink
If strict=true and a @repl block throws an exception, the build s…
Browse files Browse the repository at this point in the history
…hould fail
  • Loading branch information
DilumAluthge committed Mar 17, 2021
1 parent 22d4e43 commit 9760870
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Expanders.jl
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,21 @@ function Selectors.runner(::Type{REPLBlocks}, x, page, doc)
end
Core.eval(mod, Expr(:global, Expr(:(=), :ans, QuoteNode(c.value))))
result = c.value
allowexceptions = false # TODO: implement the `allowexceptions` kwarg for `@repl` blocks
if c.error
if allowexceptions
@debug("""
encountered an exception while running a `@repl` block
that allows exceptions
""", exception=(c.value, c.backtrace))
else
push!(doc.internal.errors, :repl_block)
@warn("""
encountered an exception while running a `@repl` block
that does not allow exceptions
""", exception=(c.value, c.backtrace))
end
end
output = if !c.error
hide = REPL.ends_with_semicolon(input)
Documenter.DocTests.result_to_string(buffer, hide ? nothing : c.value)
Expand Down

0 comments on commit 9760870

Please sign in to comment.