hlua
hlua copied to clipboard
Report better conversion errors to the Rust side
Here is a typical mistake I’ve encountered:
lua.execute::<String>("return '\\xc0'")
The Lua string returned isn’t valid UTF-8, yet the execute
call tries to convert it into a String, and fails. The only hint I have to figure out what happened is Err(WrongType)
, it would be nice to put in this error exactly why that happened, bonus points for including a representation of the original string.