Skip to content

Commit a10f63d

Browse files
committed
fix(remix): Use error message instead of whole error stack.
1 parent 249e64d commit a10f63d

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

packages/remix/src/utils/instrumentServer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function captureRemixServerException(err: Error, name: string): void {
7878
return;
7979
}
8080

81-
captureException(isResponse(err) ? extractData(err) : err, scope => {
81+
captureException(isResponse(err) ? extractData(err) : err.message, scope => {
8282
scope.addEventProcessor(event => {
8383
addExceptionMechanism(event, {
8484
type: 'instrument',

packages/remix/test/integration/test/server/action.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,16 @@ describe.each(['builtin', 'express'])('Remix API Actions with adapter = %s', ada
3737
const env = await RemixTestEnv.init(adapter);
3838
const url = `${env.url}/action-json-response/-1`;
3939

40-
const [transaction, event] = await env.getMultipleEnvelopeRequest({
40+
const envelopes = await env.getMultipleEnvelopeRequest({
4141
url,
4242
count: 2,
4343
method: 'post',
4444
envelopeType: ['transaction', 'event'],
4545
});
4646

47+
const [transaction] = envelopes.filter(envelope => envelope[1].type === 'transaction');
48+
const [event] = envelopes.filter(envelope => envelope[1].type === 'event');
49+
4750
assertSentryTransaction(transaction[2], {
4851
contexts: {
4952
trace: {
@@ -79,13 +82,16 @@ describe.each(['builtin', 'express'])('Remix API Actions with adapter = %s', ada
7982
const env = await RemixTestEnv.init(adapter);
8083
const url = `${env.url}/action-json-response/-2`;
8184

82-
const [transaction_1, event, transaction_2] = await env.getMultipleEnvelopeRequest({
85+
const envelopes = await env.getMultipleEnvelopeRequest({
8386
url,
8487
count: 3,
8588
method: 'post',
8689
envelopeType: ['transaction', 'event'],
8790
});
8891

92+
const [transaction_1, transaction_2] = envelopes.filter(envelope => envelope[1].type === 'transaction');
93+
const [event] = envelopes.filter(envelope => envelope[1].type === 'event');
94+
8995
assertSentryTransaction(transaction_1[2], {
9096
contexts: {
9197
trace: {

packages/remix/test/integration/test/server/loader.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,15 @@ describe.each(['builtin', 'express'])('Remix API Loaders with adapter = %s', ada
7777
const env = await RemixTestEnv.init(adapter);
7878
const url = `${env.url}/loader-json-response/-1`;
7979

80-
const [transaction_1, event, transaction_2] = await env.getMultipleEnvelopeRequest({
80+
const envelopes = await env.getMultipleEnvelopeRequest({
8181
url,
8282
count: 3,
8383
envelopeType: ['transaction', 'event'],
8484
});
8585

86+
const [transaction_1, transaction_2] = envelopes.filter(envelope => envelope[1].type === 'transaction');
87+
const [event] = envelopes.filter(envelope => envelope[1].type === 'event');
88+
8689
assertSentryTransaction(transaction_1[2], {
8790
contexts: {
8891
trace: {

0 commit comments

Comments
 (0)