Don't show notification after local query cancellation (#3489)

* Don't show notification after local query cancellation

* Update CHANGELOG
This commit is contained in:
Charis Kyriakou
2024-03-18 15:57:21 +00:00
committed by GitHub
parent 2d1c2349f8
commit 3f817b3c0f
2 changed files with 11 additions and 2 deletions

View File

@@ -2,6 +2,7 @@
## [UNRELEASED]
- Don't show notification after local query cancellation. [#3489](https://github.com/github/vscode-codeql/pull/3489)
- Databases created from [CodeQL test cases](https://docs.github.com/en/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/testing-custom-queries) are now copied into a shared VS Code storage location. This avoids a bug where re-running test cases would fail if the test's database is already imported into the workspace. [#3433](https://github.com/github/vscode-codeql/pull/3433)
## 1.12.3 - 29 February 2024

View File

@@ -2,7 +2,10 @@ import type {
ProgressCallback,
ProgressUpdate,
} from "../common/vscode/progress";
import { withProgress } from "../common/vscode/progress";
import {
UserCancellationException,
withProgress,
} from "../common/vscode/progress";
import type { CancellationToken, Range, TabInputText } from "vscode";
import { CancellationTokenSource, Uri, window } from "vscode";
import {
@@ -492,7 +495,12 @@ export class LocalQueries extends DisposableObject {
// to unify both error handling paths.
const err = asError(e);
await localQueryRun.fail(err);
throw e;
if (token.isCancellationRequested) {
throw new UserCancellationException(err.message, true);
} else {
throw e;
}
}
} finally {
source.dispose();