MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / extractErrorContext

Function extractErrorContext

packages/nuxt/src/runtime/utils.ts:11–28  ·  view source on GitHub ↗
(errorContext: CapturedErrorContext | undefined)

Source from the content-addressed store, hash-verified

9 * and created a structured context object.
10 */
11export 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.

Callers 2

utils.test.tsFile · 0.90
sentryCaptureErrorHookFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected