Closed sophiajt closed 4 years ago
Also many errors are returned as Function not found, including some type errors.
That's true, it is currently a limitation of our current design. We have polymorphism by just defining more functions registered with the same name to the Rhai engine. Therefore, if a type is wrong, we just assume that the proper variant doesn't exist
It certainly would be useful if the error would specify the types for which the function could not be resolved.
On Wed, Jun 13, 2018 at 11:01 AM, Lukáš Hozda [magnusi] < notifications@github.com> wrote:
That's true, it is currently a limitation of our current design. We have polymorphism by just defining more functions registered with the same name to the Rhai engine. Therefore, if a type is wrong, we just assume that the proper variant doesn't exist
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jonathandturner/rhai/issues/1#issuecomment-396867291, or mute the thread https://github.com/notifications/unsubscribe-auth/AANXDXwTNBIM7_PEnC7l-qbqCdm5n-A2ks5t8NT0gaJpZM4HpXbv .
PR https://github.com/jonathandturner/rhai/pull/98 now has pretty comprehensive error reporting. For most uses it should be enough unless we are dealing with very complicated, very large scripts...
Closing for now.
Currently, Rhai doesn't track source positions so errors have no location information. Additionally, it doesn't track the names of where errors occurred (eg: Variable not found vs Variable 'a' not found).