File tree 2 files changed +9
-6
lines changed
arduino-ide-extension/src/node
2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -370,8 +370,8 @@ export class CoreClientProvider {
370
370
) ;
371
371
progressHandler ?. reportProgress ( message ) ;
372
372
} ,
373
- reportResult : ( result ) => progressHandler ?. reportResult ( result ) ,
374
373
} ,
374
+ reportResult : ( result ) => progressHandler ?. reportResult ( result ) ,
375
375
progressId,
376
376
} )
377
377
)
Original file line number Diff line number Diff line change @@ -163,14 +163,17 @@ export namespace ExecuteWithProgress {
163
163
* _unknown_ progress if falsy.
164
164
*/
165
165
readonly progressId ?: string ;
166
- readonly responseService : Partial <
167
- ResponseService & { reportResult : ( result : DownloadResult ) => void }
168
- > ;
166
+ readonly responseService : Partial < ResponseService > ;
167
+ /**
168
+ * It's only relevant for index updates to build a summary of possible client (4xx) and server (5xx) errors when downloading the files during the index update. It's missing for lib/platform installations.
169
+ */
170
+ readonly reportResult ?: ( result : DownloadResult ) => void ;
169
171
}
170
172
171
173
export function createDataCallback < R extends ProgressResponse > ( {
172
174
responseService,
173
175
progressId,
176
+ reportResult,
174
177
} : ExecuteWithProgress . Options ) : ( response : R ) => void {
175
178
const uuid = v4 ( ) ;
176
179
let message = '' ;
@@ -252,8 +255,8 @@ export namespace ExecuteWithProgress {
252
255
} ) ;
253
256
}
254
257
} else if ( phase instanceof DownloadProgressEnd ) {
255
- if ( url ) {
256
- responseService . reportResult ?. ( {
258
+ if ( url && reportResult ) {
259
+ reportResult ( {
257
260
url,
258
261
message : phase . getMessage ( ) ,
259
262
success : phase . getSuccess ( ) ,
You can’t perform that action at this time.
0 commit comments