Skip to content

Better error handling #15

@GuillaumeLeclerc

Description

@GuillaumeLeclerc

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions