Skip to content

Commit b06d935

Browse files
committed
Improve monitor error message
This will improve the error message shown when monitoring fails. Instead of showing "Error while monitoring variant analysis: Not Found", this will now show "Error while monitoring variant analysis "Empty block (javascript) [29/3/2023 10:45:10]: Not Found". This should make it easier for the user to figure out which query history item is problematic. We're not using the full query history item label here because that would require access to the query history item, which we don't yet have here. Adding it here would add a dependency on the query history, which seems undesirable.
1 parent e6efac0 commit b06d935

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

extensions/ql-vscode/src/variant-analysis/variant-analysis-monitor.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EventEmitter } from "vscode";
1+
import { env, EventEmitter } from "vscode";
22
import { getVariantAnalysis } from "./gh-api/gh-api-client";
33

44
import {
@@ -57,7 +57,11 @@ export class VariantAnalysisMonitor extends DisposableObject {
5757
);
5858
} catch (e) {
5959
void showAndLogWarningMessage(
60-
`Error while monitoring variant analysis: ${getErrorMessage(e)}`,
60+
`Error while monitoring variant analysis ${
61+
variantAnalysis.query.name
62+
} (${variantAnalysis.query.language}) [${new Date(
63+
variantAnalysis.executionStartTime,
64+
).toLocaleString(env.language)}]: ${getErrorMessage(e)}`,
6165
);
6266
continue;
6367
}

0 commit comments

Comments
 (0)