gitlab.com/evatix-go/core@v1.3.55/errcore/ErrorWithTracesRefToError.go (about)

     1  package errcore
     2  
     3  func ErrorWithTracesRefToError(
     4  	err error,
     5  	traces []string,
     6  	reference interface{},
     7  ) error {
     8  	if err == nil {
     9  		return nil
    10  	}
    11  
    12  	if len(traces) == 0 {
    13  		return ErrorWithRefToError(err, reference)
    14  	}
    15  
    16  	tracesCompiled := StackTracesCompiled(traces)
    17  
    18  	return ErrorWithCompiledTraceRefToError(
    19  		err,
    20  		tracesCompiled,
    21  		reference)
    22  }