Skip to content

Commit 59b9b24

Browse files
committed
fix: include error property in xhr and fetch callbacks
1 parent ac1a42e commit 59b9b24

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

packages/browser/src/tracing/request.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ function xhrCallback(
343343

344344
onRequestSpanEnd?.(span, {
345345
headers: createHeadersSafely(parseXhrResponseHeaders(xhr as XMLHttpRequest & SentryWrappedXMLHttpRequest)),
346+
error: handlerData.error,
346347
});
347348

348349
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete

packages/core/src/fetch.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ export function _callOnRequestSpanEnd(
160160

161161
onRequestSpanEnd?.(span, {
162162
headers: handlerData.response?.headers,
163+
error: handlerData.error,
163164
});
164165
}
165166

0 commit comments

Comments
 (0)