-
-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
lua doStringSync can get lua traceback
lua.doStringSync(`
local a = 1
local throw_error = function()
error('test error')
end
-- throw_error()
-- local ret = pcall(throw_error, a)
local throw_error_wrap = function()
throw_error()
end
print('before throw_error_wrap')
throw_error_wrap()
print('after throw_error_wrap')
result:
Error: [string "..."]:5: test error
stack traceback:
[string "..."]:5: in upvalue 'throw_error'
[string "..."]:13: in local 'throw_error_wrap'
[string "..."]:17: in main chunk
but use doString api, can not get lua traceback, only get error line
lua.doString(`
local a = 1
local throw_error = function()
error('test error')
end
-- throw_error()
-- local ret = pcall(throw_error, a)
local throw_error_wrap = function()
throw_error()
end
print('before throw_error_wrap')
throw_error_wrap()
print('after throw_error_wrap')
result:
error Error: [string "..."]:5: test error
divmgl
Metadata
Metadata
Assignees
Labels
No labels