Skip to content

Commit

Permalink
More robust error throw & update Pluto (#179)
Browse files Browse the repository at this point in the history
Fixes #169

Also updates Pluto to 0.19.39.
  • Loading branch information
rikhuijzer authored Feb 21, 2024
1 parent 6a2fdad commit 4f3dfda
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PlutoStaticHTML"
uuid = "359b1769-a58e-495b-9770-312e911026ad"
authors = ["Rik Huijzer <github@huijzer.xyz>"]
version = "6.0.19"
version = "6.0.20"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand All @@ -20,7 +20,7 @@ tectonic_jll = "d7dd28d6-a5e6-559c-9131-7eb760cdacc5"
[compat]
AbstractTrees = "0.4"
Gumbo = "0.8"
Pluto = "=0.19.37"
Pluto = "=0.19.39"
PrecompileTools = "1.1"
RelocatableFolders = "0.3, 1"
julia = "1.6"
Expand Down
18 changes: 11 additions & 7 deletions src/output.jl
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,19 @@ function _throw_if_error(session::ServerSession, nb::Notebook)
continue
end
end
filename = _indent(nb.path)
code = _indent(cell.code)
body = cell.output.body::Dict{Symbol,Any}
msg = body[:msg]::String
val = body[:stacktrace]::CapturedException
io = IOBuffer()
ioc = IOContext(io, :color => Base.get_have_color())
showerror(ioc, val)
error_text = _indent(String(take!(io)))
code = _indent(cell.code)
filename = _indent(nb.path)
error_text::String = if body[:stacktrace] isa CapturedException
val = body[:stacktrace]::CapturedException
io = IOBuffer()
ioc = IOContext(io, :color => Base.get_have_color())
showerror(ioc, val)
_indent(String(take!(io)))
else
_indent(string(body[:stacktrace])::String)
end
msg = """
Execution of notebook failed.
Does the notebook show any errors when opening it in Pluto?
Expand Down

2 comments on commit 4f3dfda

@rikhuijzer
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

Fixed a bug in the logic for printing stacktraces. Also updated Pluto to version 0.19.39 (the Pluto version is pinned because this package depends on Pluto internals).

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/101338

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v6.0.20 -m "<description of version>" 4f3dfda487133617f4681df94956b8795c0c883c
git push origin v6.0.20

Please sign in to comment.