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

Error reporting #32

Open
cpfr opened this issue Aug 8, 2015 · 3 comments
Open

Error reporting #32

cpfr opened this issue Aug 8, 2015 · 3 comments

Comments

@cpfr
Copy link
Contributor

cpfr commented Aug 8, 2015

In many cases the exception classes do not receive an ASTNode object, therefore the error reporting can not provide a line number of the error (which is not very helpful in many cases):

ResolveVisitor caught error in null: ...

instead of

ResolveVisitor caught error in line 7, char 13: ...

The problem is that those exceptions are thrown inside the Scope class, which does not have any node objects associated, thus there is no node to pass to the exception object.

Any suggestions are appreciated.

@lukasoyen
Copy link
Member

That is indeed a problem. Please refer to the rejected #1.

@cpfr
Copy link
Contributor Author

cpfr commented Aug 8, 2015

I'm not sure if I understand the discussion correctly. You suggested that
"proper error messages via populated exceptions is a good reason to pass them in."

You mean passing an ASTNode to the resolve methods? How is this different from what lpradel did?

@lukasoyen
Copy link
Member

That is what happend with this commit https://github.com/lpradel/moco/commit/e3b4bb03846bbafb0dd97b2e374f2bb660254e8b. I can't remember why it wasn't merged.

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

2 participants