Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ test.describe('client-side errors', async () => {
value: 'Error thrown from Nuxt-3 E2E test app',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand Down Expand Up @@ -49,6 +50,7 @@ test.describe('client-side errors', async () => {
value: 'Error thrown from Param Route Button',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand Down Expand Up @@ -82,6 +84,7 @@ test.describe('client-side errors', async () => {
value: 'Error thrown from Nuxt-3 E2E test app',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand All @@ -96,6 +99,7 @@ test.describe('client-side errors', async () => {
value: 'Another Error thrown from Nuxt-3 E2E test app',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,23 @@ test.describe('server-side errors', async () => {

expect(error.transaction).toEqual('GET /api/server-error');

const exception = error.exception.values[0];
expect(exception.type).toEqual('Error');
expect(exception.value).toEqual('Nuxt 3 Server error');
expect(exception.mechanism.handled).toBe(false);
const exception0 = error.exception.values[0];
const exception1 = error.exception.values[1];

expect(exception0.type).toEqual('Error');
expect(exception0.value).toEqual('Nuxt 3 Server error');
expect(exception0.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
exception_id: 1,
parent_id: 0,
source: 'cause',
});

expect(exception1.type).toEqual('Error');
expect(exception1.value).toEqual('Nuxt 3 Server error');
// TODO: This isn't correct but requires adjustment in the core SDK
expect(exception1.mechanism).toEqual({ handled: true, type: 'generic', exception_id: 0 });
Comment on lines +17 to +33
Copy link
Member Author

@Lms24 Lms24 Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this is an interesting one: Apparently we capture two linked errors for these server errors. I didn't know this but I guess this is somehow related to useFetch (?)

I thought the mechanism type incorrectly falls back to generic via linkedErrorsIntegration() but it doesn't seem to be the cause. It can't come from the Nuxt SDK itself (I didn't find any other captureException calls) and our nodeFetchInstrumentation doesn't do it either. So not yet sure where this is coming from but we'll get there eventually.

});

test('captures api fetch error (fetched on click) with parametrized route', async ({ page }) => {
Expand All @@ -32,9 +45,22 @@ test.describe('server-side errors', async () => {

expect(error.transaction).toEqual('GET /api/param-error/1234');

const exception = error.exception.values[0];
expect(exception.type).toEqual('Error');
expect(exception.value).toEqual('Nuxt 3 Param Server error');
expect(exception.mechanism.handled).toBe(false);
const exception0 = error.exception.values[0];
const exception1 = error.exception.values[1];

expect(exception0.type).toEqual('Error');
expect(exception0.value).toEqual('Nuxt 3 Param Server error');
expect(exception0.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
exception_id: 1,
parent_id: 0,
source: 'cause',
});

expect(exception1.type).toEqual('Error');
expect(exception1.value).toEqual('Nuxt 3 Param Server error');
// TODO: This isn't correct but requires adjustment in the core SDK
expect(exception1.mechanism).toEqual({ handled: true, type: 'generic', exception_id: 0 });
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ test.describe('client-side errors', async () => {
value: 'Error thrown from Nuxt-3-min E2E test app',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand Down Expand Up @@ -49,6 +50,7 @@ test.describe('client-side errors', async () => {
value: 'Error thrown from Param Route Button',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand Down Expand Up @@ -82,6 +84,7 @@ test.describe('client-side errors', async () => {
value: 'Error thrown from Nuxt-3-min E2E test app',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand All @@ -96,6 +99,7 @@ test.describe('client-side errors', async () => {
value: 'Another Error thrown from Nuxt-3-min E2E test app',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,23 @@ test.describe('server-side errors', async () => {

expect(error.transaction).toEqual('GET /api/server-error');

const exception = error.exception.values[0];
expect(exception.type).toEqual('Error');
expect(exception.value).toEqual('Nuxt 3 Server error');
expect(exception.mechanism.handled).toBe(false);
const exception0 = error.exception.values[0];
const exception1 = error.exception.values[1];

expect(exception0.type).toEqual('Error');
expect(exception0.value).toEqual('Nuxt 3 Server error');
expect(exception0.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
exception_id: 1,
parent_id: 0,
source: 'cause',
});

// TODO: This isn't correct but requires adjustment in the core SDK
expect(exception1.type).toEqual('Error');
expect(exception1.value).toEqual('Nuxt 3 Server error');
expect(exception1.mechanism).toEqual({ handled: true, type: 'generic', exception_id: 0 });
});

test('captures api fetch error (fetched on click) with parametrized route', async ({ page }) => {
Expand All @@ -32,9 +45,22 @@ test.describe('server-side errors', async () => {

expect(error.transaction).toEqual('GET /api/param-error/1234');

const exception = error.exception.values[0];
expect(exception.type).toEqual('Error');
expect(exception.value).toEqual('Nuxt 3 Param Server error');
expect(exception.mechanism.handled).toBe(false);
const exception0 = error.exception.values[0];
const exception1 = error.exception.values[1];

expect(exception0.type).toEqual('Error');
expect(exception0.value).toEqual('Nuxt 3 Param Server error');
expect(exception0.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
exception_id: 1,
parent_id: 0,
source: 'cause',
});

// TODO: This isn't correct but requires adjustment in the core SDK
expect(exception1.type).toEqual('Error');
expect(exception1.value).toEqual('Nuxt 3 Param Server error');
expect(exception1.mechanism).toEqual({ handled: true, type: 'generic', exception_id: 0 });
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ test.describe('client-side errors', async () => {
value: 'Error thrown from Nuxt-3 E2E test app',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand Down Expand Up @@ -49,6 +50,7 @@ test.describe('client-side errors', async () => {
value: 'Error thrown from Param Route Button',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand Down Expand Up @@ -82,6 +84,7 @@ test.describe('client-side errors', async () => {
value: 'Error thrown from Nuxt-3 E2E test app',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand All @@ -96,6 +99,7 @@ test.describe('client-side errors', async () => {
value: 'Another Error thrown from Nuxt-3 E2E test app',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,23 @@ test.describe('server-side errors', async () => {

expect(error.transaction).toEqual('GET /api/server-error');

const exception = error.exception.values[0];
expect(exception.type).toEqual('Error');
expect(exception.value).toEqual('Nuxt 3 Server error');
expect(exception.mechanism.handled).toBe(false);
const exception0 = error.exception.values[0];
const exception1 = error.exception.values[1];

expect(exception0.type).toEqual('Error');
expect(exception0.value).toEqual('Nuxt 3 Server error');
expect(exception0.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
exception_id: 1,
parent_id: 0,
source: 'cause',
});

expect(exception1.type).toEqual('Error');
expect(exception1.value).toEqual('Nuxt 3 Server error');
// TODO: This isn't correct but requires adjustment in the core SDK
expect(exception1.mechanism).toEqual({ handled: true, type: 'generic', exception_id: 0 });

expect(error.tags?.['my-isolated-tag']).toBe(true);
expect(error.tags?.['my-global-scope-isolated-tag']).not.toBeDefined();
Expand Down Expand Up @@ -63,9 +76,22 @@ test.describe('server-side errors', async () => {

expect(error.transaction).toEqual('GET /api/param-error/1234');

const exception = error.exception.values[0];
expect(exception.type).toEqual('Error');
expect(exception.value).toEqual('Nuxt 3 Param Server error');
expect(exception.mechanism.handled).toBe(false);
const exception0 = error.exception.values[0];
const exception1 = error.exception.values[1];

expect(exception0.type).toEqual('Error');
expect(exception0.value).toEqual('Nuxt 3 Param Server error');
expect(exception0.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
exception_id: 1,
parent_id: 0,
source: 'cause',
});

expect(exception1.type).toEqual('Error');
expect(exception1.value).toEqual('Nuxt 3 Param Server error');
// TODO: This isn't correct but requires adjustment in the core SDK
expect(exception1.mechanism).toEqual({ handled: true, type: 'generic', exception_id: 0 });
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ test.describe('client-side errors', async () => {
value: 'Error thrown from Nuxt-3 E2E test app',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand Down Expand Up @@ -62,6 +63,7 @@ test.describe('client-side errors', async () => {
value: 'Error thrown in Error Boundary',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand Down Expand Up @@ -90,6 +92,7 @@ test.describe('client-side errors', async () => {
value: 'Error thrown from Param Route Button',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand Down Expand Up @@ -123,6 +126,7 @@ test.describe('client-side errors', async () => {
value: 'Error thrown from Nuxt-3 E2E test app',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand All @@ -137,6 +141,7 @@ test.describe('client-side errors', async () => {
value: 'Another Error thrown from Nuxt-3 E2E test app',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,23 @@ test.describe('server-side errors', async () => {

expect(error.transaction).toEqual('GET /api/server-error');

const exception = error.exception.values[0];
expect(exception.type).toEqual('Error');
expect(exception.value).toEqual('Nuxt 3 Server error');
expect(exception.mechanism.handled).toBe(false);
const exception0 = error.exception.values[0];
const exception1 = error.exception.values[1];

expect(exception0.type).toEqual('Error');
expect(exception0.value).toEqual('Nuxt 3 Server error');
expect(exception0.mechanism).toEqual({
handled: false,
type: 'chained',
exception_id: 1,
parent_id: 0,
source: 'cause',
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Incorrect Error Mechanism Type in Tests

The nuxt-3 server error tests in errors.server.test.ts incorrectly expect exception0.mechanism.type to be 'chained'. It should be 'auto.function.nuxt.nitro' to align with the captureErrorHook.ts implementation and other Nuxt test applications.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my local e2e test run disagrees but I agree this is incredibly weird


expect(exception1.type).toEqual('Error');
expect(exception1.value).toEqual('Nuxt 3 Server error');
// TODO: This isn't correct but requires adjustment in the core SDK
expect(exception1.mechanism).toEqual({ handled: true, type: 'generic', exception_id: 0 });
});

test('captures api fetch error (fetched on click) with parametrized route', async ({ page }) => {
Expand All @@ -32,9 +45,22 @@ test.describe('server-side errors', async () => {

expect(error.transaction).toEqual('GET /api/param-error/1234');

const exception = error.exception.values[0];
expect(exception.type).toEqual('Error');
expect(exception.value).toEqual('Nuxt 3 Param Server error');
expect(exception.mechanism.handled).toBe(false);
const exception0 = error.exception.values[0];
const exception1 = error.exception.values[1];

expect(exception0.type).toEqual('Error');
expect(exception0.value).toEqual('Nuxt 3 Param Server error');
expect(exception0.mechanism).toEqual({
handled: false,
type: 'chained',
exception_id: 1,
parent_id: 0,
source: 'cause',
});

expect(exception1.type).toEqual('Error');
expect(exception1.value).toEqual('Nuxt 3 Param Server error');
// TODO: This isn't correct but requires adjustment in the core SDK
expect(exception1.mechanism).toEqual({ handled: true, type: 'generic', exception_id: 0 });
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ test.describe('client-side errors', async () => {
value: 'Error thrown from Nuxt-4 E2E test app',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand Down Expand Up @@ -62,6 +63,7 @@ test.describe('client-side errors', async () => {
value: 'Error thrown in Error Boundary',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand Down Expand Up @@ -90,6 +92,7 @@ test.describe('client-side errors', async () => {
value: 'Error thrown from Param Route Button',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand Down Expand Up @@ -123,6 +126,7 @@ test.describe('client-side errors', async () => {
value: 'Error thrown from Nuxt-4 E2E test app',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand All @@ -137,6 +141,7 @@ test.describe('client-side errors', async () => {
value: 'Another Error thrown from Nuxt-4 E2E test app',
mechanism: {
handled: false,
type: 'auto.function.nuxt.vue-error',
},
},
],
Expand Down
Loading
Loading