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
4fc4bdcd
Unverified
Commit
4fc4bdcd
authored
May 11, 2023
by
Vignesh Mohankumar
Committed by
GitHub
May 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: propagates user rejection errors (#6533)
parent
3733570a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
errors.test.ts
src/tracing/errors.test.ts
+5
-5
errors.ts
src/tracing/errors.ts
+0
-4
No files found.
src/tracing/errors.test.ts
View file @
4fc4bdcd
...
...
@@ -74,6 +74,11 @@ describe('filterKnownErrors', () => {
expect
(
filterKnownErrors
(
ERROR
,
{
originalException
})).
toBe
(
ERROR
)
})
it
(
'
propagates user rejected request errors
'
,
()
=>
{
const
originalException
=
new
Error
(
'
user rejected transaction
'
)
expect
(
filterKnownErrors
(
ERROR
,
{
originalException
})).
toBe
(
ERROR
)
})
it
(
'
filters block number polling errors
'
,
()
=>
{
const
originalException
=
new
(
class
extends
Error
{
requestBody
=
JSON
.
stringify
({
method
:
'
eth_blockNumber
'
})
...
...
@@ -86,11 +91,6 @@ describe('filterKnownErrors', () => {
expect
(
filterKnownErrors
(
ERROR
,
{
originalException
})).
toBeNull
()
})
it
(
'
filters user rejected request errors
'
,
()
=>
{
const
originalException
=
new
Error
(
'
user rejected transaction
'
)
expect
(
filterKnownErrors
(
ERROR
,
{
originalException
})).
toBeNull
()
})
it
(
'
filters invalid HTML response errors
'
,
()
=>
{
const
originalException
=
new
SyntaxError
(
"
Unexpected token '<'
"
)
expect
(
filterKnownErrors
(
ERROR
,
{
originalException
})).
toBeNull
()
...
...
src/tracing/errors.ts
View file @
4fc4bdcd
import
{
ClientOptions
,
ErrorEvent
,
EventHint
}
from
'
@sentry/types
'
import
{
didUserReject
}
from
'
utils/swapErrorToUserReadableMessage
'
// `responseStatus` is only currently supported on certain browsers.
// see: https://caniuse.com/mdn-api_performanceresourcetiming_responsestatus
...
...
@@ -80,9 +79,6 @@ export const filterKnownErrors: Required<ClientOptions>['beforeSend'] = (event:
// If the error is a network change, it should not be considered an exception.
if
(
error
.
message
.
match
(
/underlying network changed/
))
return
null
// If the error is based on a user rejecting, it should not be considered an exception.
if
(
didUserReject
(
error
))
return
null
// This is caused by HTML being returned for a chunk from Cloudflare.
// Usually, it's the result of a 499 exception right before it, which should be handled.
// Therefore, this can be ignored.
...
...
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