(event: Event)
| 65 | * @returns event's description |
| 66 | */ |
| 67 | export function getEventDescription(event: Event): string { |
| 68 | const { message, event_id: eventId } = event; |
| 69 | if (message) { |
| 70 | return message; |
| 71 | } |
| 72 | |
| 73 | const firstException = getFirstException(event); |
| 74 | if (firstException) { |
| 75 | if (firstException.type && firstException.value) { |
| 76 | return `${firstException.type}: ${firstException.value}`; |
| 77 | } |
| 78 | return firstException.type || firstException.value || eventId || '<unknown>'; |
| 79 | } |
| 80 | return eventId || '<unknown>'; |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Adds exception values, type and value to an synthetic Exception. |
no test coverage detected