We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08fdba6 commit 4669dc5Copy full SHA for 4669dc5
packages/nitro/src/runtime/hooks/captureErrorHook.ts
@@ -5,6 +5,7 @@ import {
5
getClient,
6
getCurrentScope,
7
getRootSpan,
8
+ parseUrl,
9
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
10
} from '@sentry/core';
11
import { HTTPError } from 'h3';
@@ -23,13 +24,7 @@ function extractErrorContext(errorContext: CapturedErrorContext | undefined): Re
23
24
25
if (errorContext.event) {
26
ctx.method = errorContext.event.req.method;
-
27
- try {
28
- const url = new URL(errorContext.event.req.url);
29
- ctx.path = url.pathname;
30
- } catch {
31
- // If URL parsing fails, leave path undefined
32
- }
+ ctx.path = parseUrl(errorContext.event.req.url).path;
33
}
34
35
if (Array.isArray(errorContext.tags)) {
0 commit comments