File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -433,11 +433,16 @@ interface GoVersionWebResult {
433
433
}
434
434
async function fetchDownloadableGoVersions ( ) : Promise < GoEnvironmentOption [ ] > {
435
435
// fetch information about what Go versions are available to install
436
- const webResults = await WebRequest . json < GoVersionWebResult [ ] > ( 'https://golang.org/dl/?mode=json' ) ;
437
- if ( ! webResults ) {
436
+ let webResults ;
437
+ try {
438
+ webResults = await WebRequest . json < GoVersionWebResult [ ] > ( 'https://golang.org/dl/?mode=json' ) ;
439
+ } catch ( error ) {
438
440
return [ ] ;
439
441
}
440
442
443
+ if ( ! webResults ) {
444
+ return [ ] ;
445
+ }
441
446
// turn the web result into GoEnvironmentOption model
442
447
return webResults . reduce ( ( opts , result : GoVersionWebResult ) => {
443
448
// TODO: allow downloading from different sites
You can’t perform that action at this time.
0 commit comments