Skip to content
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

Throwing errors vs passing "false, error_message" #2

Open
CapsAdmin opened this issue Oct 31, 2020 · 0 comments
Open

Throwing errors vs passing "false, error_message" #2

CapsAdmin opened this issue Oct 31, 2020 · 0 comments

Comments

@CapsAdmin
Copy link
Owner

The typesystem at the moment passes "false, error_message" when something happens which the analyzer uses assertion for. In some cases I need to concatenate multiple errors, like when multiple type errors happen in a union.

This messes up the stack trace which in turn makes it harder to reason about where the error really comes from. I can guess since I wrote the code but sometimes I get confused.

Maybe something about passing the stack as a third value, an error object or keeping track of the current stack trace in a separate module.

I'm trying to write this using normal Lua without any implicit use of helper globals and many dependencies. Ideally I want someone to look at the for instance the tokenizer, easily be able to grasp it, take it out of NattLua without being bogged down by figuring out all the dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant