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.
This commit is contained in:
Koen Vlaswinkel
2023-10-18 16:24:15 +02:00
parent 226274cb4e
commit 046bc13fc3

View File

@@ -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();