init - add project files
This commit is contained in:
14
tools/jet-2.12.0/internal/utils/errfmt/errfmt.go
Normal file
14
tools/jet-2.12.0/internal/utils/errfmt/errfmt.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package errfmt
|
||||
|
||||
import (
|
||||
"github.com/go-jet/jet/v2/internal/utils/is"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Trace returns well formatted wrapped error trace string
|
||||
func Trace(err error) string {
|
||||
if is.Nil(err) {
|
||||
return ""
|
||||
}
|
||||
return "Error trace:\n" + " - " + strings.Replace(err.Error(), ": ", ":\n - ", -1)
|
||||
}
|
||||
Reference in New Issue
Block a user