Skip to content

Commit 72f68c0

Browse files
authored
match Copilot's CanceledError which has name == message == "Canceled". (#13357)
1 parent 3a837ec commit 72f68c0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Extension/src/LanguageServer/copilotCompletionContextProvider.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ class DefaultValueFallback extends Error {
2323

2424
class CancellationError extends Error {
2525
static readonly Canceled = "Canceled";
26-
constructor() { super(CancellationError.Canceled); }
26+
constructor() {
27+
super(CancellationError.Canceled);
28+
this.name = this.message;
29+
}
2730
}
2831

29-
class InternalCancellationError extends Error {
30-
static readonly Canceled = "CpptoolsCanceled";
31-
constructor() { super(InternalCancellationError.Canceled); }
32+
class InternalCancellationError extends CancellationError {
3233
}
3334

3435
class CopilotCancellationError extends CancellationError {

0 commit comments

Comments
 (0)