* Renders the exception entry of a latest event into readable lines: each exception's * type/value plus a compact, top-down stack frame list.
(data: SentryExceptionData)
| 275 | * type/value plus a compact, top-down stack frame list. |
| 276 | */ |
| 277 | function formatException(data: SentryExceptionData): string[] { |
| 278 | const lines: string[] = [] |
| 279 | |
| 280 | for (const value of data.values ?? []) { |
| 281 | const header = [value.type, value.value].filter(Boolean).join(': ') |
| 282 | if (header) lines.push(header) |
| 283 | |
| 284 | const frames = value.stacktrace?.frames ?? [] |
| 285 | for (const frame of frames.slice().reverse()) { |
| 286 | const location = [frame.module || frame.filename, frame.function].filter(Boolean).join(' in ') |
| 287 | const lineNo = frame.lineNo != null ? `:${frame.lineNo}` : '' |
| 288 | if (location) lines.push(` at ${location}${lineNo}`) |
| 289 | } |
| 290 | } |
| 291 | |
| 292 | return lines |
| 293 | } |
| 294 | |
| 295 | /** |
| 296 | * Formats an issue and its latest event into a single plain-text document covering the |
no test coverage detected