(text: string)
| 644 | } |
| 645 | |
| 646 | function responseForReport(text: string): { envelope?: unknown; raw?: string } { |
| 647 | try { |
| 648 | return { envelope: JSON.parse(text) as unknown }; |
| 649 | } catch { |
| 650 | return { raw: text.slice(0, 2_000) }; |
| 651 | } |
| 652 | } |
| 653 | |
| 654 | function errorForReport(error: unknown): unknown { |
| 655 | if (error instanceof Error) { |