Skip to content

Commit c963186

Browse files
Replace the deprecated canceled with Cancellation Error. (microsoft#197605)
Signed-off-by: Shubh <[email protected]>
1 parent 3051ae8 commit c963186

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/vs/base/common/paging.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import { range } from 'vs/base/common/arrays';
77
import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';
8-
import { canceled } from 'vs/base/common/errors';
8+
import { CancellationError } from 'vs/base/common/errors';
99

1010
/**
1111
* A Pager is a stateless abstraction over a paged collection.
@@ -91,7 +91,7 @@ export class PagedModel<T> implements IPagedModel<T> {
9191

9292
resolve(index: number, cancellationToken: CancellationToken): Promise<T> {
9393
if (cancellationToken.isCancellationRequested) {
94-
return Promise.reject(canceled());
94+
return Promise.reject(new CancellationError());
9595
}
9696

9797
const pageIndex = Math.floor(index / this.pager.pageSize);
@@ -154,12 +154,12 @@ export class DelayedPagedModel<T> implements IPagedModel<T> {
154154
resolve(index: number, cancellationToken: CancellationToken): Promise<T> {
155155
return new Promise((c, e) => {
156156
if (cancellationToken.isCancellationRequested) {
157-
return e(canceled());
157+
return e(new CancellationError());
158158
}
159159

160160
const timer = setTimeout(() => {
161161
if (cancellationToken.isCancellationRequested) {
162-
return e(canceled());
162+
return e(new CancellationError());
163163
}
164164

165165
timeoutCancellation.dispose();
@@ -169,7 +169,7 @@ export class DelayedPagedModel<T> implements IPagedModel<T> {
169169
const timeoutCancellation = cancellationToken.onCancellationRequested(() => {
170170
clearTimeout(timer);
171171
timeoutCancellation.dispose();
172-
e(canceled());
172+
e(new CancellationError());
173173
});
174174
});
175175
}

0 commit comments

Comments
 (0)