Skip to content

Commit cda6ebb

Browse files
committed
Use the built-in error function to trigger a fatal error
1 parent dd85259 commit cda6ebb

File tree

1 file changed

+6
-2
lines changed
  • src/resources/filters/common

1 file changed

+6
-2
lines changed

src/resources/filters/common/log.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
-- could write to named filed (e.g. <docname>.filter.log) and client could read warnings and delete (also delete before run)
66
-- always append b/c multiple filters
77

8+
--- The default, built-in error function.
9+
-- The `error` global is redefined below.
10+
local builtin_error_function = error
11+
812
-- luacov: disable
913
local function caller_info(offset)
1014
offset = offset or 3
@@ -27,6 +31,6 @@ end
2731
function fatal(message, offset)
2832
io.stderr:write(lunacolors.red("FATAL (" .. caller_info(offset) .. ") " ..message .. "\n"))
2933
-- TODO write stack trace into log, and then exit.
30-
crash_with_stack_trace()
34+
builtin_error_function('FATAL QUARTO ERROR', offset)
3135
end
32-
-- luacov: enable
36+
-- luacov: enable

0 commit comments

Comments
 (0)