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 @@ -39,7 +39,6 @@ sentryTest('captures custom AggregateErrors', async ({ getLocalTestUrl, page })
]);
});

// fixme: the mechanism should be on the error
sentryTest(
'keeps a custom capture mechanism on the captured error instead of its causes',
async ({ getLocalTestUrl, page }) => {
Expand All @@ -53,10 +52,10 @@ sentryTest(
value: 'Failure 1',
mechanism: {
exception_id: 2,
handled: false, // true,
handled: true,
parent_id: 1,
source: 'cause',
type: 'auto.http.example', // 'chained',
type: 'chained',
},
}),
expect.objectContaining({
Expand All @@ -73,8 +72,8 @@ sentryTest(
value: 'Failure 3',
mechanism: {
exception_id: 0,
handled: true, // false,
type: 'generic', // 'auto.http.example',
handled: false,
type: 'auto.http.example',
},
}),
]);
Expand Down
8 changes: 4 additions & 4 deletions dev-packages/cloudflare-integration-tests/suites/d1/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ it('captures error event when a D1 query references a non-existent table', async
value: 'no such table: non_existent_table: SQLITE_ERROR',
stacktrace: expect.any(Object),
mechanism: {
type: 'auto.http.cloudflare',
handled: false,
type: 'chained',
handled: true,
source: 'cause',
exception_id: 1,
parent_id: 0,
Expand All @@ -84,8 +84,8 @@ it('captures error event when a D1 query references a non-existent table', async
value: 'D1_ERROR: no such table: non_existent_table: SQLITE_ERROR',
stacktrace: expect.any(Object),
mechanism: {
type: 'generic',
handled: true,
type: 'auto.http.cloudflare',
handled: false,
exception_id: 0,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ test.describe('route handler errors', () => {
expect(firstCause?.value).toBe('Failure 1');
expect(firstCause?.mechanism).toEqual({
exception_id: 2,
handled: false,
handled: true,
parent_id: 1,
source: 'cause',
type: 'auto.http.hono.context_error', // should be 'chained' (general issue with LinkedErrors)
type: 'chained',
});

const secondCause = errorEvent.exception?.values?.[1];
Expand All @@ -72,8 +72,8 @@ test.describe('route handler errors', () => {
expect(capturedError?.value).toBe('Failure 3');
expect(capturedError?.mechanism).toEqual({
exception_id: 0,
handled: true,
type: 'generic', // should be 'auto.http.hono.context_error' (general issue with LinkedErrors)
handled: false,
type: 'auto.http.hono.context_error',
});

expect(errorEvent.transaction).toBe('GET /linked-error');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,22 @@ test('should capture error with trpc context', async ({ page }) => {
expect(trpcError.contexts?.trpc?.procedure_path).toBe('post.throwError');
expect(trpcError.contexts?.trpc?.input).toEqual({ name: 'I love dogs' });

expect(trpcError.exception?.values?.[0]?.mechanism).toEqual({
handled: false,
type: 'auto.rpc.trpc.middleware',
const exceptionValues = trpcError.exception?.values;
expect(exceptionValues).toHaveLength(2);
expect(exceptionValues?.[0]?.type).toBe('Error');
expect(exceptionValues?.[0]?.value).toBe('Error thrown in trpc router');
expect(exceptionValues?.[0]?.mechanism).toEqual({
handled: true,
type: 'chained',
exception_id: 1,
parent_id: 0,
source: 'cause',
});
expect(exceptionValues?.[1]?.mechanism).toEqual({
handled: false,
type: 'auto.rpc.trpc.middleware',
exception_id: 0,
});
});

test('should create transaction with trpc input for error', async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,20 @@ test.describe('server-side errors', async () => {
expect(exception0.type).toEqual('Error');
expect(exception0.value).toEqual('Nuxt 3 Server error');
expect(exception0.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
handled: true,
type: 'chained',
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(exception1.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
exception_id: 0,
});
});

test('captures api fetch error (fetched on click) with parametrized route', async ({ page }) => {
Expand All @@ -51,16 +54,19 @@ test.describe('server-side errors', async () => {
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',
handled: true,
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 });
expect(exception1.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
exception_id: 0,
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,20 @@ test.describe('server-side errors', async () => {
expect(exception0.type).toEqual('Error');
expect(exception0.value).toEqual('Nuxt 3 Server error');
expect(exception0.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
handled: true,
type: 'chained',
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 });
expect(exception1.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
exception_id: 0,
});
});

test('captures api fetch error (fetched on click) with parametrized route', async ({ page }) => {
Expand All @@ -51,16 +54,19 @@ test.describe('server-side errors', async () => {
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',
handled: true,
type: 'chained',
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 });
expect(exception1.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
exception_id: 0,
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,20 @@ test.describe('server-side errors', async () => {
expect(exception0.type).toEqual('Error');
expect(exception0.value).toEqual('Nuxt 3 Server error');
expect(exception0.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
handled: true,
type: 'chained',
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(exception1.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
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 @@ -82,16 +85,19 @@ test.describe('server-side errors', async () => {
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',
handled: true,
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 });
expect(exception1.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
exception_id: 0,
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test.describe('server-side errors', async () => {
expect(exception0.type).toEqual('Error');
expect(exception0.value).toEqual('Nuxt 3 Server error');
expect(exception0.mechanism).toEqual({
handled: false,
handled: true,
type: 'chained',
exception_id: 1,
parent_id: 0,
Expand All @@ -29,8 +29,11 @@ test.describe('server-side errors', async () => {

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(exception1.mechanism).toEqual({
handled: false,
type: 'generic',
exception_id: 0,
});
});

test('captures api fetch error (fetched on click) with parametrized route', async ({ page }) => {
Expand All @@ -51,7 +54,7 @@ test.describe('server-side errors', async () => {
expect(exception0.type).toEqual('Error');
expect(exception0.value).toEqual('Nuxt 3 Param Server error');
expect(exception0.mechanism).toEqual({
handled: false,
handled: true,
type: 'chained',
exception_id: 1,
parent_id: 0,
Expand All @@ -60,7 +63,10 @@ test.describe('server-side errors', async () => {

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 });
expect(exception1.mechanism).toEqual({
handled: false,
type: 'generic',
exception_id: 0,
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,20 @@ test.describe('server-side errors', async () => {
expect(exception0.type).toEqual('Error');
expect(exception0.value).toEqual('Nuxt 4 Server error');
expect(exception0.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
handled: true,
type: 'chained',
exception_id: 1,
parent_id: 0,
source: 'cause',
});

expect(exception1.type).toEqual('Error');
expect(exception1.value).toEqual('Nuxt 4 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(exception1.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
exception_id: 0,
});
});

test('captures api fetch error (fetched on click) with parametrized route', async ({ page }) => {
Expand All @@ -51,16 +54,19 @@ test.describe('server-side errors', async () => {
expect(exception0.type).toEqual('Error');
expect(exception0.value).toEqual('Nuxt 4 Param Server error');
expect(exception0.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
handled: true,
type: 'chained',
exception_id: 1,
parent_id: 0,
source: 'cause',
});

expect(exception1.type).toEqual('Error');
expect(exception1.value).toEqual('Nuxt 4 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 });
expect(exception1.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
exception_id: 0,
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,20 @@ test.describe('server-side errors', async () => {
expect(exception0.type).toEqual('Error');
expect(exception0.value).toEqual('Nuxt 4 Server error');
expect(exception0.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
handled: true,
type: 'chained',
exception_id: 1,
parent_id: 0,
source: 'cause',
});

expect(exception1.type).toEqual('HTTPError');
expect(exception1.value).toEqual('Nuxt 4 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(exception1.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
exception_id: 0,
});
});

test('captures api fetch error (fetched on click) with parametrized route', async ({ page }) => {
Expand All @@ -51,16 +54,19 @@ test.describe('server-side errors', async () => {
expect(exception0.type).toEqual('Error');
expect(exception0.value).toEqual('Nuxt 4 Param Server error');
expect(exception0.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
handled: true,
type: 'chained',
exception_id: 1,
parent_id: 0,
source: 'cause',
});

expect(exception1.type).toEqual('HTTPError');
expect(exception1.value).toEqual('Nuxt 4 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 });
expect(exception1.mechanism).toEqual({
handled: false,
type: 'auto.function.nuxt.nitro',
exception_id: 0,
});
});
});
Loading
Loading