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

Better error handling #15

Open
GuillaumeLeclerc opened this issue Oct 5, 2016 · 0 comments
Open

Better error handling #15

GuillaumeLeclerc opened this issue Oct 5, 2016 · 0 comments

Comments

@GuillaumeLeclerc
Copy link

GuillaumeLeclerc commented Oct 5, 2016

This is a good project but it's very hard to know what's wrong. We only know when there is a problem by getting undefined.. But if the expression does not return anything and only have a side effect then we don't even know if the code was executed or if there was a problem in the AST.

I suggest static-eval could use Errors instead of the FAIL object. This way it would not be needed to check everytime of something is equal fo FAIL and the end user would get more information about the error.

For example I spent 30 minutes figuring out why I was receiving undefined for a perfectly valid expression. It was simply that 'NewExpression' was not handled (This is not a problem of course, this is open source community someone else can implement that) but with Errors I would have known right away.

Would you accept a pull request using Error instead of FAIL ?

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