-
Notifications
You must be signed in to change notification settings - Fork 329
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
Surface fatal CLI errors in interpret-results
and run-queries
#1407
Conversation
e455355
to
212a20b
Compare
I have some unit test errors resulting from my changes. Now that
It looks like |
I think we'll need to stub |
Ugh! Not sure how I missed that line. Thanks!! |
Actually, I see that |
Co-authored-by: Henry Mercer <[email protected]>
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.
Nice!
Our error logging often doesn't highlight the most relevant part of CLI errors, when they occur (see #1283 for an example, where the actual error from CLI was hidden amongst other emitted logs).
This change only addresses this specific case; it:
errorMatcher
that will allow us to match any error from the CLI that includes "A fatal error occurred"codeql database run-queries
andcodeql database interpret-results
commands.In the future, we will refactor the error logging mechanism or use the existing mechanism to match more classes of errors.
I have tested this change on a private repository (for Hubbers, link). Once the step fails, the log for the
analyze
step ends with:which will allow users to scroll to the bottom of the log and find the appropriate error as they expect.
(It's perhaps not ideal that the stack trace shows the stack trace of the error matcher itself, which correctly matches the error and throws it, but this was the mechanism in place and I haven't been able to think of something better. The appropriate CLI error prints just before the stack trace).
Merge / deployment checklist