(error: { toReport(): Record<string, unknown>; toString(): string })
| 294 | } |
| 295 | |
| 296 | export const tryToReport = (error: { toReport(): Record<string, unknown>; toString(): string }) => { |
| 297 | try { |
| 298 | return error.toReport() |
| 299 | } catch { |
| 300 | try { |
| 301 | return { error: error.toString() } |
| 302 | } catch (err) { |
| 303 | try { |
| 304 | return { error: `Failed to convert error: ${err}` } |
| 305 | } catch { |
| 306 | return { error: `Failed to convert error: unknown failure` } |
| 307 | } |
| 308 | } |
| 309 | } |
| 310 | } |
no test coverage detected
searching dependent graphs…