Browse Source

Update docstrings

pull/124/head
Morten Piibeleht 5 years ago
parent
commit
37e0ce53d0
  1. 14
      src/Literate.jl

14
src/Literate.jl

@ -706,14 +706,16 @@ function execute_block(sb::Module, block::String)
# Push a capturing display on the displaystack # Push a capturing display on the displaystack
disp = LiterateDisplay() disp = LiterateDisplay()
pushdisplay(disp) pushdisplay(disp)
# r is the result # We use the following fields of the object returned by IOCapture.capture:
# status = (true|false) # - c.value: return value of the do-block (or the error object, if it throws)
# _: backtrace # - c.error: set to `true` if the do-block throws an error
# str combined stdout, stderr output # - c.output: combined stdout and stderr
c = IOCapture.capture(rethrow = InterruptException) do # `rethrow = Union{}` means that we try-catch all the exceptions thrown in the do-block
# and return them via the return value (they get handled below).
c = IOCapture.capture(rethrow = Union{}) do
include_string(sb, block) include_string(sb, block)
end end
popdisplay(disp) # Documenter.withoutput has a try-catch so should always end up here popdisplay(disp) # IOCapture.capture has a try-catch so should always end up here
if c.error if c.error
error(""" error("""
$(sprint(showerror, c.value)) $(sprint(showerror, c.value))

Loading…
Cancel
Save