@@ -363,9 +363,12 @@ func runStatusAll(ctx *dep.Ctx, out outputter, p *dep.Project, sm gps.SourceMana
363
363
364
364
logger .Println ("Checking upstream projects:" )
365
365
366
- // BasicStatus channel
366
+ // BasicStatus channel to collect all the BasicStatus
367
367
bsCh := make (chan * BasicStatus , len (slp ))
368
368
369
+ // Error channel to collect all the errors
370
+ errorCh := make (chan error , len (slp ))
371
+
369
372
var wg sync.WaitGroup
370
373
371
374
for i , proj := range slp {
@@ -387,7 +390,7 @@ func runStatusAll(ctx *dep.Ctx, out outputter, p *dep.Project, sm gps.SourceMana
387
390
ptr , err := sm .ListPackages (proj .Ident (), proj .Version ())
388
391
389
392
if err != nil {
390
- // return digestMismatch, hasMissingPkgs, errors.Wrapf( err, "analysis of %s package failed", proj.Ident().ProjectRoot)
393
+ errorCh <- err
391
394
}
392
395
393
396
prm , _ := ptr .ToReachMap (true , false , false , nil )
@@ -452,8 +455,18 @@ func runStatusAll(ctx *dep.Ctx, out outputter, p *dep.Project, sm gps.SourceMana
452
455
453
456
wg .Wait ()
454
457
close (bsCh )
458
+ close (errorCh )
455
459
logger .Println ()
456
460
461
+ if len (errorCh ) > 0 {
462
+ bsErr := errors .New ("failed to fetch updates" )
463
+ for err := range errorCh {
464
+ ctx .Err .Println (err .Error ())
465
+ }
466
+ ctx .Err .Println ()
467
+ return digestMismatch , hasMissingPkgs , bsErr
468
+ }
469
+
457
470
// A map of ProjectRoot and *BasicStatus. This is used in maintain the
458
471
// order of BasicStatus in output by collecting all the BasicStatus and
459
472
// then using them in order.
0 commit comments