Skip to content

feat(lua_ffi): make WrongType error more verbose

Alexey Protsenko requested to merge wrong-type-verbosity into master

This patch extends the WrongType error structure with expected / actual type names. Example:

let mut lua: Lua = crate::hlua::global();
let mut f = LuaFunction::load(&mut lua, "return 'abcd'").unwrap();
let x: i32 = f.call().unwrap();
// panicked at 'called `Result::unwrap()` on an `Err` value: WrongType("i32", "string")'

Before the patch, it was just "WrongType" with no details.

Merge request reports