Improve generator error handling
This commit is contained in:
parent
b38b63d804
commit
06ecd73f67
12 changed files with 386 additions and 176 deletions
10
internal/utils/errfmt/errfmt.go
Normal file
10
internal/utils/errfmt/errfmt.go
Normal 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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue