Closed Saturn745 closed 2 months ago
Can you please provide more context? The following triggers Lua errors for me:
$ java -jar /tmp/example-all.jar -l 5.4
Running Lua 5.4
Use license() to print licensing info.
>>> S = java.import("java.lang.String")
>>> S(1)
no matching constructor found
>>> S():toString(1)
no matching method found
>>> ok = pcall(function() S():toString(1) end); print(ok)
false
If you are using the Java API, currently you will need to check the return value of functions like Lua#run
for Lua errors, similar to lua_dostring
in Lua C API.
But, yes, having to check the return value every time is rather bothersome. Probably a reworking of the API is needed for this.
Yes I am using the Java API. Forgot to mention that.
If you are using the Java API, currently you will need to check the return value of functions like
Lua#run
for Lua errors, similar tolua_dostring
in Lua C API.
Thanks this pointed me in the right direction. I got it working now.
Describe the bug All Lua errors/exceptions are "silent"
To Reproduce Steps to reproduce the behavior: Make any valid error such as calling a Java method without the right arguments, call a Java method which throws an exception, or a syntax error
Current behavior Nothing happens, no errors at all.
Expected behavior Some sort of error/exception on what went wrong (bad syntax, Java exception throw, etc)
Platform:
Additional context N/A