@@ -76,10 +76,11 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
76
76
. filter ( notEmpty )
77
77
. shift ( ) ?? error . details
78
78
) ;
79
- this . sendResponse (
80
- error . details + '\n\n' + message ,
81
- OutputMessage . Severity . Error
79
+ const chunk = new TextEncoder ( ) . encode (
80
+ `${ error . details } '\n\n'${ message } `
82
81
) ;
82
+ handler . addChunk ( chunk , OutputMessage . Severity . Error ) ;
83
+
83
84
reject ( CoreError . VerifyFailed ( message , compilerErrors ) ) ;
84
85
}
85
86
} )
@@ -181,7 +182,8 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
181
182
firstToUpperCase ( task ) ,
182
183
error . details
183
184
) ;
184
- this . sendResponse ( error . details , OutputMessage . Severity . Error ) ;
185
+ const chunk = new TextEncoder ( ) . encode ( error . details ) ;
186
+ handler . addChunk ( chunk , OutputMessage . Severity . Error ) ;
185
187
reject (
186
188
errorHandler (
187
189
message ,
@@ -245,7 +247,8 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
245
247
) ;
246
248
reject ( error ) ;
247
249
} else {
248
- this . sendResponse ( error . details , OutputMessage . Severity . Error ) ;
250
+ const chunk = new TextEncoder ( ) . encode ( error . details ) ;
251
+ handler . addChunk ( chunk , OutputMessage . Severity . Error ) ;
249
252
reject (
250
253
CoreError . BurnBootloaderFailed (
251
254
nls . localize (
@@ -288,6 +291,7 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
288
291
private createOnDataHandler < R extends StreamingResponse > ( ) : Disposable & {
289
292
stderr : Buffer [ ] ;
290
293
onData : ( response : R ) => void ;
294
+ addChunk : ( chunk : Uint8Array , severity ?: OutputMessage . Severity ) => void ;
291
295
} {
292
296
const stderr : Buffer [ ] = [ ] ;
293
297
const buffer = new SimpleBuffer ( ( chunks ) => {
@@ -301,10 +305,14 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
301
305
buffer . addChunk ( out ) ;
302
306
buffer . addChunk ( err , OutputMessage . Severity . Error ) ;
303
307
} ) ;
308
+ const addChunk = ( chunk : Uint8Array , severity ?: OutputMessage . Severity ) =>
309
+ buffer . addChunk ( chunk , severity ) ;
310
+
304
311
return {
305
312
dispose : ( ) => buffer . dispose ( ) ,
306
313
stderr,
307
314
onData,
315
+ addChunk,
308
316
} ;
309
317
}
310
318
0 commit comments