(err error)
| 27 | ) |
| 28 | |
| 29 | func FormatError(err error) string { |
| 30 | if err == nil { |
| 31 | return "nil" |
| 32 | } |
| 33 | var s strings.Builder |
| 34 | for i, err := range errors.Stack(err) { |
| 35 | s.WriteString(fmt.Sprintf(` |
| 36 | %s-> %s (attributes: %v)`, |
| 37 | strings.Repeat("-", i), err, errors.Attributes(err), |
| 38 | )) |
| 39 | } |
| 40 | return s.String() |
| 41 | } |
| 42 | |
| 43 | // Delay is the value, which can be used to slowdown the execution of time-dependent tests. |
| 44 | // You can assume, that most function calls will return in at most Delay time. |