diff options
author | Jonas Schievink <jonasschievink@gmail.com> | 2017-08-02 14:01:00 +0200 |
---|---|---|
committer | Jonas Schievink <jonasschievink@gmail.com> | 2017-08-02 14:01:00 +0200 |
commit | 70f05ac06884c1fe6742f73b103014beae7e4554 (patch) | |
tree | b2d8a2587cdcc86040062ad81039bb265a0e69b8 /src/util.rs | |
parent | a43bfd8f63eab7dce353a1ca28234a8fd6f3b00f (diff) | |
download | mlua-70f05ac06884c1fe6742f73b103014beae7e4554.zip |
Remove ErrorError
Diffstat (limited to 'src/util.rs')
-rw-r--r-- | src/util.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/util.rs b/src/util.rs index 345db98..e91b955 100644 --- a/src/util.rs +++ b/src/util.rs @@ -287,7 +287,12 @@ pub unsafe fn handle_error(state: *mut ffi::lua_State, err: c_int) -> Result<()> message: err_string, } } - ffi::LUA_ERRERR => Error::ErrorError(err_string), + ffi::LUA_ERRERR => { + // This can only happen when rlua's own message handler raises an error, which + // should never happen unless there's a bug. This would also be dangerous as it + // longjmps over Rust frames. + lua_panic!(state, "message handler raised error: {}", err_string); + } ffi::LUA_ERRMEM => { // This is not impossible to hit, but this library is not set up // to handle this properly. Lua does a longjmp on out of memory |