append errors to output buffer

This commit is contained in:
Kartik K. Agaram 2023-12-15 16:18:42 -08:00
parent 09658a0e3a
commit 018c2d09e4
1 changed files with 3 additions and 1 deletions

View File

@ -1,7 +1,9 @@
send_errors_to_output = function(err)
local callstack = debug.traceback('', 3)
local error_with_callstack = cleaned_up_frame(tostring(err))..'\n'..cleaned_up_callstack(callstack)
Text.insert_text(Current_pane.output_editor_state, error_with_callstack)
table.insert(Current_pane.output_editor_state.lines, {data=''})
Current_pane.output_editor_state.cursor1 = {line=#Current_pane.output_editor_state.lines, pos=1}
Text.redraw_all(Current_pane.output_editor_state)
Text.insert_text(Current_pane.output_editor_state, error_with_callstack)
clear_handlers()
end