(errorContext: CapturedErrorContext | undefined)
| 9 | * and created a structured context object. |
| 10 | */ |
| 11 | export function extractErrorContext(errorContext: CapturedErrorContext | undefined): Context { |
| 12 | const ctx: Context = {}; |
| 13 | |
| 14 | if (!errorContext) { |
| 15 | return ctx; |
| 16 | } |
| 17 | |
| 18 | if (errorContext.event) { |
| 19 | ctx.method = errorContext.event._method; |
| 20 | ctx.path = errorContext.event._path; |
| 21 | } |
| 22 | |
| 23 | if (Array.isArray(errorContext.tags)) { |
| 24 | ctx.tags = errorContext.tags; |
| 25 | } |
| 26 | |
| 27 | return ctx; |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * Adds Sentry tracing <meta> tags to the returned html page. |
no outgoing calls
no test coverage detected