Skip to content

Commit

Permalink
Ensure that errors due to env instantiation are printed
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHatherly committed Nov 26, 2024
1 parent c02c2d3 commit fa242b2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/worker.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ function worker_init(f::File, options::Dict)

push!(LOAD_PATH, $(project))

# When a manifest already exists ensure the environment is able to
# be precompiled with the version of Julia that is using it. If we
# just proceed to import `QuartoNotebookWorker` directly then these
# potential errors are not passed back to the server process, thus
# hiding the issues.
let manifest = Base.project_file_manifest_path(Base.active_project())
if isfile(manifest)
import Pkg # Exists in the `project` environment.
Pkg.precompile(; strict = true) # Throws an error when it fails.
end
end

let QNW = task_local_storage(:QUARTO_NOTEBOOK_WORKER_OPTIONS, $(options)) do
Base.require(
Base.PkgId(
Expand Down

0 comments on commit fa242b2

Please sign in to comment.