Surface fatal CLI errors in interpret-results and run-queries#1407
Surface fatal CLI errors in interpret-results and run-queries#1407angelapwen merged 8 commits intomainfrom
interpret-results and run-queries#1407Conversation
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 <henry.mercer@me.com>
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:
errorMatcherthat will allow us to match any error from the CLI that includes "A fatal error occurred"codeql database run-queriesandcodeql database interpret-resultscommands.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
analyzestep 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