Improve generator error handling

This commit is contained in:
go-jet 2023-07-21 13:20:44 +02:00
parent b38b63d804
commit 06ecd73f67
12 changed files with 386 additions and 176 deletions

View file

@ -0,0 +1,10 @@
package errfmt
import (
"strings"
)
// Trace returns well formatted wrapped error trace string
func Trace(err error) string {
return "Error trace:\n" + " - " + strings.Replace(err.Error(), ": ", ":\n - ", -1)
}