github.com/cosmos/cosmos-sdk@v0.50.10/internal/util.go (about)

     1  package util
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  func CombineErrors(ret, also error, desc string) error {
     8  	if also != nil {
     9  		if ret != nil {
    10  			ret = fmt.Errorf("%w; %v: %v", ret, desc, also)
    11  		} else {
    12  			ret = also
    13  		}
    14  	}
    15  	return ret
    16  }