-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(nestjs): Filter 4xx errors #12695
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
130ab89
Filter 4xx errors in nest
nicohrubec 3ac6824
Lint
nicohrubec 0a500a2
Add baseline for e2e test
nicohrubec 5cc987f
Finish e2e test#
nicohrubec 06b9dd4
Change e2e to use transaction end as cutoff
nicohrubec 26ade2f
Lint
nicohrubec 8d5560f
Fix e2e
nicohrubec 9e480ad
Fix e2e
nicohrubec a78a013
Lint
nicohrubec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -11,6 +11,9 @@ test('Sends exception to Sentry', async ({ baseURL }) => { | |||||
|
||||||
const errorEvent = await errorEventPromise; | ||||||
|
||||||
console.log("UNEXPECTED EXCEPTION"); | ||||||
console.log(errorEvent); | ||||||
|
||||||
expect(errorEvent.exception?.values).toHaveLength(1); | ||||||
expect(errorEvent.exception?.values?.[0]?.value).toBe('This is an exception with id 123'); | ||||||
|
||||||
|
@@ -28,3 +31,19 @@ test('Sends exception to Sentry', async ({ baseURL }) => { | |||||
span_id: expect.any(String), | ||||||
}); | ||||||
}); | ||||||
|
||||||
test('Does not send expected exception to Sentry', async ({ baseURL }) => { | ||||||
const errorEventPromise = waitForError('nestjs', event => { | ||||||
return !event.type && event.exception?.values?.[0]?.value === 'This is an unexpected exception with id 123'; | ||||||
}); | ||||||
|
||||||
const response = await fetch(`${baseURL}/test-expected-exception/123`); | ||||||
expect(response.status).toBe(403); | ||||||
|
||||||
const errorEvent = await errorEventPromise; | ||||||
|
||||||
console.log("EXPECTED EXCEPTION"); | ||||||
console.log(errorEvent); | ||||||
|
||||||
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.
Suggested change
I guess a leftover of debugging? :D 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. Yes! Sorry the test was not done yet, I just pushed for debugging. Should have put it back into draft mode :) |
||||||
expect(errorEvent.exception?.values).toHaveLength(1); | ||||||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.