-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref(nuxt): Add and adjust mechanism.type
in error events
#17599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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', | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Incorrect Error Mechanism Type in TestsThe Additional Locations (1)There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 }) => { | ||
|
@@ -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 }); | ||
}); | ||
}); |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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
vialinkedErrorsIntegration()
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 ournodeFetchInstrumentation
doesn't do it either. So not yet sure where this is coming from but we'll get there eventually.