( stackParser: StackParser, exception: unknown, hint?: EventHint, attachStacktrace?: boolean, )
| 225 | * @hidden |
| 226 | */ |
| 227 | export function eventFromException( |
| 228 | stackParser: StackParser, |
| 229 | exception: unknown, |
| 230 | hint?: EventHint, |
| 231 | attachStacktrace?: boolean, |
| 232 | ): PromiseLike<Event> { |
| 233 | const syntheticException = hint?.syntheticException || undefined; |
| 234 | const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace); |
| 235 | addExceptionMechanism(event); // defaults to { type: 'generic', handled: true } |
| 236 | event.level = 'error'; |
| 237 | if (hint?.event_id) { |
| 238 | event.event_id = hint.event_id; |
| 239 | } |
| 240 | return resolvedSyncPromise(event); |
| 241 | } |
| 242 | |
| 243 | /** |
| 244 | * Builds and Event from a Message |
no test coverage detected