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
It would be very helpful if there was some way to get span information for Lua errors – especially stuff like syntax errors. This would allow users to provide much better error diagnostics when something goes wrong. Especially in case of applications that expose Lua to the user, such as when Lua is used as a configuration language, or for embedded expressions in templating logic, this could massively improve the user experience.
I am very unfamiliar with the actual API that the different Lua implementations expose internally, so this might just be impossible to achieve... But I would hope that it isn't.
We are getting a line number in the rendered error message, and from what I can see at least during runtime there seems to be some ways to get that sort of information via inspect_stack.
Having a simple error_span: Option<Range<usize>> representing offsets into the loaded lua code where the error occurred would be perfect, but even just getting the line number, or the span of the surrounding scope, or whatever is viable to implement, would already be a massive help.
The text was updated successfully, but these errors were encountered:
It would be very helpful if there was some way to get span information for Lua errors – especially stuff like syntax errors. This would allow users to provide much better error diagnostics when something goes wrong. Especially in case of applications that expose Lua to the user, such as when Lua is used as a configuration language, or for embedded expressions in templating logic, this could massively improve the user experience.
I am very unfamiliar with the actual API that the different Lua implementations expose internally, so this might just be impossible to achieve... But I would hope that it isn't.
We are getting a line number in the rendered error message, and from what I can see at least during runtime there seems to be some ways to get that sort of information via inspect_stack.
Having a simple
error_span: Option<Range<usize>>
representing offsets into the loaded lua code where the error occurred would be perfect, but even just getting the line number, or the span of the surrounding scope, or whatever is viable to implement, would already be a massive help.The text was updated successfully, but these errors were encountered: