Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
c673c9e4
Unverified
Commit
c673c9e4
authored
Jun 26, 2023
by
Vignesh Mohankumar
Committed by
GitHub
Jun 26, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: filter user reject errors temporarily (#6840)
parent
dd957d07
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
errors.test.ts
src/tracing/errors.test.ts
+2
-2
errors.ts
src/tracing/errors.ts
+5
-0
No files found.
src/tracing/errors.test.ts
View file @
c673c9e4
...
@@ -54,9 +54,9 @@ describe('beforeSend', () => {
...
@@ -54,9 +54,9 @@ describe('beforeSend', () => {
expect
(
beforeSend
(
ERROR
,
{
originalException
})).
toBe
(
ERROR
)
expect
(
beforeSend
(
ERROR
,
{
originalException
})).
toBe
(
ERROR
)
})
})
it
(
'
propagate
s user rejected request errors
'
,
()
=>
{
it
(
'
filter
s user rejected request errors
'
,
()
=>
{
const
originalException
=
new
Error
(
'
user rejected transaction
'
)
const
originalException
=
new
Error
(
'
user rejected transaction
'
)
expect
(
beforeSend
(
ERROR
,
{
originalException
})).
toBe
(
ERROR
)
expect
(
beforeSend
(
ERROR
,
{
originalException
})).
toBe
Null
(
)
})
})
it
(
'
filters block number polling errors
'
,
()
=>
{
it
(
'
filters block number polling errors
'
,
()
=>
{
...
...
src/tracing/errors.ts
View file @
c673c9e4
import
{
ClientOptions
,
ErrorEvent
,
EventHint
}
from
'
@sentry/types
'
import
{
ClientOptions
,
ErrorEvent
,
EventHint
}
from
'
@sentry/types
'
import
{
didUserReject
}
from
'
utils/swapErrorToUserReadableMessage
'
// `responseStatus` is only currently supported on certain browsers.
// `responseStatus` is only currently supported on certain browsers.
// see: https://caniuse.com/mdn-api_performanceresourcetiming_responsestatus
// see: https://caniuse.com/mdn-api_performanceresourcetiming_responsestatus
...
@@ -50,6 +51,10 @@ function shouldRejectError(error: EventHint['originalException']) {
...
@@ -50,6 +51,10 @@ function shouldRejectError(error: EventHint['originalException']) {
if
(
method
===
'
eth_blockNumber
'
)
return
true
if
(
method
===
'
eth_blockNumber
'
)
return
true
}
}
// If the error is based on a user rejecting, it should not be considered an exception.
// TODO(WEB-2398): we should catch these errors and handle them gracefully instead.
if
(
didUserReject
(
error
))
return
true
// If the error is a network change, it should not be considered an exception.
// If the error is a network change, it should not be considered an exception.
if
(
error
.
message
.
match
(
/underlying network changed/
))
return
true
if
(
error
.
message
.
match
(
/underlying network changed/
))
return
true
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment