From 838e0547c9d4856bdc4be8684590da88beddf448 Mon Sep 17 00:00:00 2001 From: Koen Vlaswinkel Date: Wed, 18 Oct 2023 16:24:15 +0200 Subject: [PATCH] Try generating evaluation log summary after failed query 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. --- .../ql-vscode/src/local-queries/local-query-run.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/extensions/ql-vscode/src/local-queries/local-query-run.ts b/extensions/ql-vscode/src/local-queries/local-query-run.ts index b6686c31e9f..3df13119256 100644 --- a/extensions/ql-vscode/src/local-queries/local-query-run.ts +++ b/extensions/ql-vscode/src/local-queries/local-query-run.ts @@ -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 { + 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();