You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a followup to #293, which I have closed because it does not accurately describe the issue. I would like to throw an error out of c++ and have it appear as a runtime error in Lua with file and line number information. If I throw the error from a function created with addFunction, it works. However, if I throw the error from the same c++ function registered withaddProperty, I do not get the file and line number info.
I am using Lua 5.2.4, which I compile and embed directly into my program, along with LuaBridge.
Here is a test case that compiles and illustrates the issue:
Here are three different ways to encounter this runtime error in Lua. Obviously, the first one it hits aborts the script, so you have to comment out the ones you don't want to see.
test.standalone_error() --> reports file and line number along with the errorlocalerrorclass=test.error_class()
localx=errorclass:class_error() --> reports file and line number along with the errorlocaly=errorclass.property_error--> reports the error but no file or line number information
The text was updated successfully, but these errors were encountered:
rpatters1
changed the title
Thrown an error from a Property with location information included
Throw an error from a Property with location information included
Sep 2, 2022
This is a followup to #293, which I have closed because it does not accurately describe the issue. I would like to throw an error out of c++ and have it appear as a runtime error in Lua with file and line number information. If I throw the error from a function created with
addFunction
, it works. However, if I throw the error from the same c++ function registered withaddProperty
, I do not get the file and line number info.I am using Lua 5.2.4, which I compile and embed directly into my program, along with LuaBridge.
Here is a test case that compiles and illustrates the issue:
Here are three different ways to encounter this runtime error in Lua. Obviously, the first one it hits aborts the script, so you have to comment out the ones you don't want to see.
The text was updated successfully, but these errors were encountered: