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

     1  package errcore
     2  
     3  import (
     4  	"strings"
     5  
     6  	"gitlab.com/evatix-go/core/constants"
     7  )
     8  
     9  // PathMeaningfulMessage skip error if messages empty or length 0
    10  func PathMeaningfulMessage(
    11  	rawErrType RawErrorType,
    12  	funcName string,
    13  	location string,
    14  	messages ...string,
    15  ) error {
    16  	if len(messages) == 0 {
    17  		return nil
    18  	}
    19  
    20  	messagesCompiled := strings.Join(messages, constants.Space)
    21  	errMsg := "location: [" + location + "], " + messagesCompiled
    22  
    23  	return rawErrType.Error(
    24  		funcName,
    25  		errMsg)
    26  }