Skip to content

Commit

Permalink
fix(core): Avoid internal error when also erroring due to user provid…
Browse files Browse the repository at this point in the history
…ed content errors
  • Loading branch information
alerque committed Dec 5, 2024
1 parent d38ff03 commit d83e63c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/sile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ local function runEvals (evals, arg)
for _, snippet in ipairs(evals) do
local pId = SILE.traceStack:pushText(snippet)
local status, func = pcall(load, snippet)
if status then
if status and type(func) == "function" then
func()
else
SU.error(("Error parsing code provided in --%s snippet: %s"):format(arg, func))
SU.error(("Error parsing code provided in --%s snippet: %s"):format(arg, snippet))
end
SILE.traceStack:pop(pId)
end
Expand Down

0 comments on commit d83e63c

Please sign in to comment.