(stackParser: StackParser, error: Error)
| 45 | * Extracts stack frames from the error and builds a Sentry Exception |
| 46 | */ |
| 47 | export function exceptionFromError(stackParser: StackParser, error: Error): Exception { |
| 48 | const exception: Exception = { |
| 49 | type: error.name || error.constructor.name, |
| 50 | value: _enhanceErrorWithSentryInfo(error), |
| 51 | }; |
| 52 | |
| 53 | const frames = parseStackFrames(stackParser, error); |
| 54 | if (frames.length) { |
| 55 | exception.stacktrace = { frames }; |
| 56 | } |
| 57 | |
| 58 | return exception; |
| 59 | } |
| 60 | |
| 61 | /** If a plain object has a property that is an `Error`, return this error. */ |
| 62 | function getErrorPropertyFromObject(obj: Record<string, unknown>): Error | undefined { |
no test coverage detected