( stack: string, error: Error, annotations: ReadonlyMap<string, unknown> | undefined )
| 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 | |
| 407 | const cleanErrorStack = ( |
| 408 | stack: string, |
| 409 | error: Error, |
| 410 | annotations: ReadonlyMap<string, unknown> | undefined |
| 411 | ): string => { |
| 412 | const message = `${error.name}: ${error.message}` |
| 413 | const lines = (stack.startsWith(message) ? stack.slice(message.length) : stack).split("\n") |
| 414 | const out: Array<string> = [message] |
| 415 | for (let i = 1; i < lines.length; i++) { |
| 416 | if (/(?:Generator\.next|~effect\/Effect)/.test(lines[i])) { |
| 417 | break |
no test coverage detected
searching dependent graphs…