@@ -8,7 +8,7 @@ import { CancelablePromise, createCancelablePromise, timeout } from 'vs/base/com
8
8
import { VSBuffer } from 'vs/base/common/buffer' ;
9
9
import { CancellationToken , CancellationTokenSource } from 'vs/base/common/cancellation' ;
10
10
import { memoize } from 'vs/base/common/decorators' ;
11
- import * as errors from 'vs/base/common/errors' ;
11
+ import { CancellationError } from 'vs/base/common/errors' ;
12
12
import { Emitter , Event , EventMultiplexer , Relay } from 'vs/base/common/event' ;
13
13
import { combinedDisposable , DisposableStore , dispose , IDisposable , toDisposable } from 'vs/base/common/lifecycle' ;
14
14
import { revive } from 'vs/base/common/marshalling' ;
@@ -516,7 +516,7 @@ export class ChannelClient implements IChannelClient, IDisposable {
516
516
return {
517
517
call ( command : string , arg ?: any , cancellationToken ?: CancellationToken ) {
518
518
if ( that . isDisposed ) {
519
- return Promise . reject ( errors . canceled ( ) ) ;
519
+ return Promise . reject ( new CancellationError ( ) ) ;
520
520
}
521
521
return that . requestPromise ( channelName , command , arg , cancellationToken ) ;
522
522
} ,
@@ -535,14 +535,14 @@ export class ChannelClient implements IChannelClient, IDisposable {
535
535
const request : IRawRequest = { id, type, channelName, name, arg } ;
536
536
537
537
if ( cancellationToken . isCancellationRequested ) {
538
- return Promise . reject ( errors . canceled ( ) ) ;
538
+ return Promise . reject ( new CancellationError ( ) ) ;
539
539
}
540
540
541
541
let disposable : IDisposable ;
542
542
543
543
const result = new Promise ( ( c , e ) => {
544
544
if ( cancellationToken . isCancellationRequested ) {
545
- return e ( errors . canceled ( ) ) ;
545
+ return e ( new CancellationError ( ) ) ;
546
546
}
547
547
548
548
const doRequest = ( ) => {
@@ -591,7 +591,7 @@ export class ChannelClient implements IChannelClient, IDisposable {
591
591
this . sendRequest ( { id, type : RequestType . PromiseCancel } ) ;
592
592
}
593
593
594
- e ( errors . canceled ( ) ) ;
594
+ e ( new CancellationError ( ) ) ;
595
595
} ;
596
596
597
597
const cancellationTokenListener = cancellationToken . onCancellationRequested ( cancel ) ;
0 commit comments