github.com/golang/dep@v0.5.4/cmd/dep/failures.go (about)

     1  // Copyright 2018 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package main
     6  
     7  import (
     8  	"context"
     9  
    10  	"github.com/golang/dep/gps"
    11  	"github.com/pkg/errors"
    12  )
    13  
    14  // TODO solve failures can be really creative - we need to be similarly creative
    15  // in handling them and informing the user appropriately
    16  func handleAllTheFailuresOfTheWorld(err error) error {
    17  	switch errors.Cause(err) {
    18  	case context.Canceled, context.DeadlineExceeded, gps.ErrSourceManagerIsReleased:
    19  		return nil
    20  	}
    21  
    22  	return errors.Wrap(err, "Solving failure")
    23  }