ErrorStack returns a string representation of the annotated error. If the error passed as the parameter is not an annotated error, the result is simply the result of the Error() method on that error. If the error is an annotated error, a multi-line string is returned where each line represents one
(err error)
| 285 | // github.com/juju/errors/annotation_test.go:196: more context |
| 286 | // github.com/juju/errors/annotation_test.go:197: |
| 287 | func ErrorStack(err error) string { |
| 288 | return strings.Join(errorStack(err), "\n") |
| 289 | } |
| 290 | |
| 291 | func errorStack(err error) []string { |
| 292 | if err == nil { |
searching dependent graphs…