-
-
Notifications
You must be signed in to change notification settings - Fork 703
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
Handle internal errors elegantly and report the triggering sql file #632
Conversation
2449b0b
to
7863508
Compare
7863508
to
6e6929f
Compare
f1418cb
to
809fc66
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never had seen the traceback
module before, cool stuff 😎 .
Would you be able to at a test cast for a file that will cause an internal error, and make sure it gets the nice error message?
Had a lot of fun working out how to write a test case for this. Good call and thanks! |
@NiallRees I'm not sure exactly how to test that PR haha, but just wanted to double check that we know which file in a directory caused the internal issue in case it's raised? I'm seeing your test is on a specific file like |
I did this as a follow up to #600, where it took ages to work out what sql file was surfacing the error. Does that answer your question? Not sure I quite understand. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll sleep better knowing this test is here 😴
Ah, I got confused, thanks for linking the issue |
At present, if an attempt to lint a file fails due to an unhandled internal error, the linting process quits and doesn't report which file is causing the issue. This makes it hard to identify what file has surfaced the internal error, which you need to do in order to .sqlfluffignore the file and work around it. This PR prints the exception as a warning with the file that has surfaced the issue.
Outcome: