(errorDetails: ErrorDetail[])
| 158 | |
| 159 | // Utility to create previous error context for fatal errors |
| 160 | export function createPreviousErrorContext(errorDetails: ErrorDetail[]) { |
| 161 | if (errorDetails.length === 0) return undefined; |
| 162 | |
| 163 | return { |
| 164 | count: errorDetails.length, |
| 165 | types: [...new Set(errorDetails.map((e) => e.type))], |
| 166 | buckets: [...new Set(errorDetails.map((e) => e.bucket).filter(Boolean))], |
| 167 | }; |
| 168 | } |
| 169 | |
| 170 | // Utility to create aggregated error analytics |
| 171 | export function aggregateErrorAnalytics( |