@@ -22,6 +22,7 @@ import { VSBuffer } from 'vs/base/common/buffer';
22
22
import { ILogger , ILoggerService , ILogService } from 'vs/platform/log/common/log' ;
23
23
import { CancellationToken , CancellationTokenSource } from 'vs/base/common/cancellation' ;
24
24
import { OutputChannelUpdateMode } from 'vs/workbench/services/output/common/output' ;
25
+ import { isCancellationError } from 'vs/base/common/errors' ;
25
26
26
27
export interface IOutputChannelModel extends IDisposable {
27
28
readonly onDispose : Event < void > ;
@@ -61,7 +62,11 @@ class OutputFileListener extends Disposable {
61
62
62
63
private poll ( ) : void {
63
64
const loop = ( ) => this . doWatch ( ) . then ( ( ) => this . poll ( ) ) ;
64
- this . syncDelayer . trigger ( loop ) ;
65
+ this . syncDelayer . trigger ( loop ) . catch ( error => {
66
+ if ( ! isCancellationError ( error ) ) {
67
+ throw error ;
68
+ }
69
+ } ) ;
65
70
}
66
71
67
72
private async doWatch ( ) : Promise < void > {
@@ -206,7 +211,7 @@ export class FileOutputChannelModel extends Disposable implements IOutputChannel
206
211
this . doUpdateModel ( model , [ EditOperation . delete ( model . getFullModelRange ( ) ) ] , VSBuffer . fromString ( '' ) ) ;
207
212
}
208
213
209
- private async appendContent ( model : ITextModel , immediate : boolean , token : CancellationToken ) : Promise < void > {
214
+ private appendContent ( model : ITextModel , immediate : boolean , token : CancellationToken ) : void {
210
215
this . appendThrottler . trigger ( async ( ) => {
211
216
/* Abort if operation is cancelled */
212
217
if ( token . isCancellationRequested ) {
@@ -234,7 +239,11 @@ export class FileOutputChannelModel extends Disposable implements IOutputChannel
234
239
const lastLineMaxColumn = model . getLineMaxColumn ( lastLine ) ;
235
240
const edits = [ EditOperation . insert ( new Position ( lastLine , lastLineMaxColumn ) , contentToAppend . toString ( ) ) ] ;
236
241
this . doUpdateModel ( model , edits , contentToAppend ) ;
237
- } , immediate ? 0 : undefined ) ;
242
+ } , immediate ? 0 : undefined ) . catch ( error => {
243
+ if ( ! isCancellationError ( error ) ) {
244
+ throw error ;
245
+ }
246
+ } ) ;
238
247
}
239
248
240
249
private async replaceContent ( model : ITextModel , token : CancellationToken ) : Promise < void > {
0 commit comments