ErrorStack returns formatted full error stack message
()
| 81 | |
| 82 | // ErrorStack returns formatted full error stack message |
| 83 | func (e Error) ErrorStack() string { |
| 84 | switch e.Err.(type) { |
| 85 | case *Error: |
| 86 | return fmt.Sprintf("HTTP %d (%s) at %s from", e.Status, http.StatusText(e.Status), e.Origin) + walkErrorStack(e.Err.(*Error)) |
| 87 | default: |
| 88 | return fmt.Sprintf("HTTP %d (%s) at %s: %+v", e.Status, http.StatusText(e.Status), e.Origin, e.Err) |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | func walkErrorStack(e *Error) string { |
| 93 | if e == nil { |
no test coverage detected