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

     1  package errcore
     2  
     3  import (
     4  	"gitlab.com/evatix-go/core/internal/strutilinternal"
     5  )
     6  
     7  func MeaningfulErrorWithData(
     8  	rawErrType RawErrorType,
     9  	funcName string,
    10  	err error,
    11  	data interface{},
    12  ) error {
    13  	if err == nil {
    14  		return nil
    15  	}
    16  
    17  	return rawErrType.Error(
    18  		funcName,
    19  		err.Error()+strutilinternal.AnyToString(data))
    20  }