Skip to content

Commit 41e0372

Browse files
authored
ref(browser): Add more specific mechanism.type to errors captured by httpClientIntegration (#17254)
ref #17212 closes #17250
1 parent eefa756 commit 41e0372

File tree

7 files changed

+10
-7
lines changed

7 files changed

+10
-7
lines changed

dev-packages/browser-integration-tests/suites/integrations/httpclient/axios/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ sentryTest(
3636
type: 'Error',
3737
value: 'HTTP Client Error with status code: 500',
3838
mechanism: {
39-
type: 'http.client',
39+
type: 'auto.http.client.xhr',
4040
handled: false,
4141
},
4242
stacktrace: {

dev-packages/browser-integration-tests/suites/integrations/httpclient/fetch/simple/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ sentryTest(
3838
type: 'Error',
3939
value: 'HTTP Client Error with status code: 500',
4040
mechanism: {
41-
type: 'http.client',
41+
type: 'auto.http.client.fetch',
4242
handled: false,
4343
},
4444
stacktrace: {

dev-packages/browser-integration-tests/suites/integrations/httpclient/fetch/withRequest/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ sentryTest('works with a Request passed in', async ({ getLocalTestUrl, page }) =
3434
type: 'Error',
3535
value: 'HTTP Client Error with status code: 500',
3636
mechanism: {
37-
type: 'http.client',
37+
type: 'auto.http.client.fetch',
3838
handled: false,
3939
},
4040
stacktrace: {

dev-packages/browser-integration-tests/suites/integrations/httpclient/fetch/withRequestAndBodyAndOptions/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ sentryTest(
3636
type: 'Error',
3737
value: 'HTTP Client Error with status code: 500',
3838
mechanism: {
39-
type: 'http.client',
39+
type: 'auto.http.client.fetch',
4040
handled: false,
4141
},
4242
stacktrace: {

dev-packages/browser-integration-tests/suites/integrations/httpclient/fetch/withRequestAndOptions/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ sentryTest('works with a Request (without body) & options passed in', async ({ g
3434
type: 'Error',
3535
value: 'HTTP Client Error with status code: 500',
3636
mechanism: {
37-
type: 'http.client',
37+
type: 'auto.http.client.fetch',
3838
handled: false,
3939
},
4040
stacktrace: {

dev-packages/browser-integration-tests/suites/integrations/httpclient/xhr/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ sentryTest(
3636
type: 'Error',
3737
value: 'HTTP Client Error with status code: 500',
3838
mechanism: {
39-
type: 'http.client',
39+
type: 'auto.http.client.xhr',
4040
handled: false,
4141
},
4242
stacktrace: {

packages/browser/src/integrations/httpclient.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ function _fetchResponseHandler(
9393
requestCookies,
9494
responseCookies,
9595
error,
96+
type: 'fetch',
9697
});
9798

9899
captureEvent(event);
@@ -165,6 +166,7 @@ function _xhrResponseHandler(
165166
responseHeaders,
166167
responseCookies,
167168
error,
169+
type: 'xhr',
168170
});
169171

170172
captureEvent(event);
@@ -362,6 +364,7 @@ function _createEvent(data: {
362364
url: string;
363365
method: string;
364366
status: number;
367+
type: 'fetch' | 'xhr';
365368
responseHeaders?: Record<string, string>;
366369
responseCookies?: Record<string, string>;
367370
requestHeaders?: Record<string, string>;
@@ -402,7 +405,7 @@ function _createEvent(data: {
402405
};
403406

404407
addExceptionMechanism(event, {
405-
type: 'http.client',
408+
type: `auto.http.client.${data.type}`,
406409
handled: false,
407410
});
408411

0 commit comments

Comments
 (0)