Skip to content

Commit

Permalink
Try generating evaluation log summary after failed query
Browse files Browse the repository at this point in the history
When a local query fails (for example, if it is cancelled), it may still
have an evaluation log. We weren't generating evaluation log summaries
in these cases, so the options to view the summary text and to use the
evaluation log viewer would not be available. This fixes it by also
trying to generate the summary in the case of a failed query.
  • Loading branch information
koesie10 committed Oct 18, 2023
1 parent 513099b commit 838e054
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions extensions/ql-vscode/src/local-queries/local-query-run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ export class LocalQueryRun {
* Updates the UI in the case where query evaluation throws an exception.
*/
public async fail(err: Error): Promise<void> {
const evalLogPaths = await this.summarizeEvalLog(
QueryResultType.OTHER_ERROR,
this.outputDir,
this.logger,
);
if (evalLogPaths !== undefined) {
this.queryInfo.setEvaluatorLogPaths(evalLogPaths);
}

err.message = `Error running query: ${err.message}`;
this.queryInfo.failureReason = err.message;
await this.queryHistoryManager.refreshTreeView();
Expand Down

0 comments on commit 838e054

Please sign in to comment.