(error: Error, depth = 0)
| 88 | } |
| 89 | |
| 90 | function formatError(error: Error, depth = 0): string { |
| 91 | const result = error.message |
| 92 | return error.cause instanceof Error && depth < 10 |
| 93 | ? result + " Caused by: " + formatError(error.cause, depth + 1) |
| 94 | : result |
| 95 | } |
| 96 | |
| 97 | let last = Date.now() |
| 98 | export function create(tags?: Record<string, any>) { |