Skip to content

Commit e8565ee

Browse files
committed
Use err_msg instead of formatting msg
1 parent cc68846 commit e8565ee

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

src/pluginscript_callbacks.lua

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,7 @@ local function print_coroutine_error(co, err, msg_prefix)
5454
if not filename then
5555
filename, line, err_msg = '?', -1, err
5656
end
57-
local msg_lines = {
58-
(msg_prefix or '') .. debug_traceback(co, err_msg, 1),
59-
}
60-
for i = #lps_callstack, 1, -1 do
61-
table_insert(msg_lines, table_concat(lps_callstack[i], ' '))
62-
end
63-
local msg = table_concat(msg_lines, '\n\tin ')
64-
api.godot_print_error(
65-
("%s:%d: %s"):format(filename, tonumber(line), msg:match("[%w%p%s]-%c"):gsub('%c', '', 1)), debug_getinfo(co, 0, 'n').name, filename, tonumber(line)
66-
)
57+
api.godot_print_error((msg_prefix or filename .. ':' .. line .. ': ') .. err_msg, debug_getinfo(co, 0, 'n').name, filename, tonumber(line))
6758
end
6859

6960
local function wrap_callback(f, error_return)

0 commit comments

Comments
 (0)