-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
errors returned from pcall contains serialized binaries #164
Comments
The trouble is that the value of the of the arguments can be any valid Lua data type. Try:
|
Ah yes, I see, the format throws argument errors when the format param is not compatible. So to fix this we would need So that the format_error would look like this: format_error({badarg,Where,As}) ->
io_lib:format("badarg in ~s: ~s", [format_where(Where), format_args(As)]); |
You have discovered another bug which needs fixing first. 😄 The I will fix that first and then we can get back to the error message from |
The |
One thing is that the current |
The thing is that this formatting happens in the pcall, so these binaries are returned to the lua code. These users may not be familiar to these erlang binary format . |
This has now been fixed a commit in the develop branch dd78ff5 |
after running this code:
The error variable contains
badarg in ipairs: [<<104,101,108,108,111>>]
Expected:
badarg in ipairs: ["hello"]
The reason for this formatting is that the format_error uses ~w formatting.
Would it be possible to use ~s in the error formatting functions?
The text was updated successfully, but these errors were encountered: