mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
Don't dispose whole traceback when it's not utf-8
This commit is contained in:
+1
-2
@@ -376,8 +376,7 @@ pub unsafe fn pcall_with_traceback(
|
||||
if let Some(error) = pop_wrapped_error(state) {
|
||||
ffi::luaL_traceback(state, state, ptr::null(), 0);
|
||||
let traceback = CStr::from_ptr(ffi::lua_tolstring(state, -1, ptr::null_mut()))
|
||||
.to_str()
|
||||
.unwrap_or_else(|_| "<could not capture traceback>")
|
||||
.to_string_lossy()
|
||||
.to_owned();
|
||||
push_wrapped_error(state, Error::CallbackError {
|
||||
traceback,
|
||||
|
||||
Reference in New Issue
Block a user