5
5
6
6
import { range } from 'vs/base/common/arrays' ;
7
7
import { CancellationToken , CancellationTokenSource } from 'vs/base/common/cancellation' ;
8
- import { canceled } from 'vs/base/common/errors' ;
8
+ import { CancellationError } from 'vs/base/common/errors' ;
9
9
10
10
/**
11
11
* A Pager is a stateless abstraction over a paged collection.
@@ -91,7 +91,7 @@ export class PagedModel<T> implements IPagedModel<T> {
91
91
92
92
resolve ( index : number , cancellationToken : CancellationToken ) : Promise < T > {
93
93
if ( cancellationToken . isCancellationRequested ) {
94
- return Promise . reject ( canceled ( ) ) ;
94
+ return Promise . reject ( new CancellationError ( ) ) ;
95
95
}
96
96
97
97
const pageIndex = Math . floor ( index / this . pager . pageSize ) ;
@@ -154,12 +154,12 @@ export class DelayedPagedModel<T> implements IPagedModel<T> {
154
154
resolve ( index : number , cancellationToken : CancellationToken ) : Promise < T > {
155
155
return new Promise ( ( c , e ) => {
156
156
if ( cancellationToken . isCancellationRequested ) {
157
- return e ( canceled ( ) ) ;
157
+ return e ( new CancellationError ( ) ) ;
158
158
}
159
159
160
160
const timer = setTimeout ( ( ) => {
161
161
if ( cancellationToken . isCancellationRequested ) {
162
- return e ( canceled ( ) ) ;
162
+ return e ( new CancellationError ( ) ) ;
163
163
}
164
164
165
165
timeoutCancellation . dispose ( ) ;
@@ -169,7 +169,7 @@ export class DelayedPagedModel<T> implements IPagedModel<T> {
169
169
const timeoutCancellation = cancellationToken . onCancellationRequested ( ( ) => {
170
170
clearTimeout ( timer ) ;
171
171
timeoutCancellation . dispose ( ) ;
172
- e ( canceled ( ) ) ;
172
+ e ( new CancellationError ( ) ) ;
173
173
} ) ;
174
174
} ) ;
175
175
}
0 commit comments