Handle LUA_ERRERR
This commit is contained in:
parent
70f05ac068
commit
dd1d335cee
|
@ -288,10 +288,11 @@ pub unsafe fn handle_error(state: *mut ffi::lua_State, err: c_int) -> Result<()>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ffi::LUA_ERRERR => {
|
ffi::LUA_ERRERR => {
|
||||||
// This can only happen when rlua's own message handler raises an error, which
|
// The Lua manual documents this error wrongly: It is not raised when a message
|
||||||
// should never happen unless there's a bug. This would also be dangerous as it
|
// handler errors, but rather when some specific situations regarding stack
|
||||||
// longjmps over Rust frames.
|
// overflow handling occurs. Since it is not very useful do differentiate
|
||||||
lua_panic!(state, "message handler raised error: {}", err_string);
|
// between that and "ordinary" runtime errors, we handle them the same way.
|
||||||
|
Error::RuntimeError(err_string)
|
||||||
}
|
}
|
||||||
ffi::LUA_ERRMEM => {
|
ffi::LUA_ERRMEM => {
|
||||||
// This is not impossible to hit, but this library is not set up
|
// This is not impossible to hit, but this library is not set up
|
||||||
|
|
Loading…
Reference in New Issue