(u: Record<string, unknown> | Error)
| 386 | } |
| 387 | |
| 388 | const causePrettyMessage = (u: Record<string, unknown> | Error): string => { |
| 389 | if (typeof u.message === "string") { |
| 390 | return u.message |
| 391 | } else if ( |
| 392 | typeof u.toString === "function" |
| 393 | && u.toString !== Object.prototype.toString |
| 394 | && u.toString !== Array.prototype.toString |
| 395 | ) { |
| 396 | try { |
| 397 | return u.toString() |
| 398 | } catch { |
| 399 | // something's off, rollback to json |
| 400 | } |
| 401 | } |
| 402 | return formatJson(u) |
| 403 | } |
| 404 | |
| 405 | const locationRegExp = /\((.*)\)/g |
| 406 |
no test coverage detected