hlua icon indicating copy to clipboard operation
hlua copied to clipboard

Report better conversion errors to the Rust side

Open linkmauve opened this issue 6 years ago • 0 comments

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.

linkmauve avatar Nov 03 '17 01:11 linkmauve