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
c2a972eb
Unverified
Commit
c2a972eb
authored
May 02, 2023
by
Vignesh Mohankumar
Committed by
GitHub
May 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: filter chrome-extension errors (#6475)
* fix: filter chrome-extension errors in Sentry * check stack
parent
47a2768d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
errors.test.ts
src/tracing/errors.test.ts
+11
-0
errors.ts
src/tracing/errors.ts
+4
-0
No files found.
src/tracing/errors.test.ts
View file @
c2a972eb
...
...
@@ -40,6 +40,17 @@ describe('filterKnownErrors', () => {
expect
(
filterKnownErrors
(
ERROR
,
{
originalException
})).
toBeNull
()
})
it
(
'
filters chrome-extension errors
'
,
()
=>
{
const
originalException
=
new
Error
()
originalException
.
stack
=
`
TypeError: Cannot create proxy with a non-object as target or handler
at pa(chrome-extension://kbjhmlgclljgdhmhffjofbobmficicjp/proxy-window-evm.a5430696.js:22:216604)
at da(chrome-extension://kbjhmlgclljgdhmhffjofbobmficicjp/proxy-window-evm.a5430696.js:22:212968)
at a(../../../../src/helpers.ts:98:1)
`
expect
(
filterKnownErrors
(
ERROR
,
{
originalException
})).
toBeNull
()
})
describe
(
'
OneKey
'
,
()
=>
{
it
(
'
filter OneKey errors (macOS users)
'
,
()
=>
{
const
originalException
=
new
Error
()
...
...
src/tracing/errors.ts
View file @
c2a972eb
...
...
@@ -76,6 +76,10 @@ export const filterKnownErrors: Required<ClientOptions>['beforeSend'] = (event:
// Therefore, this can be ignored.
if
(
error
.
message
.
match
(
/Unexpected token '<'/
))
return
null
// Errors coming from a Chrome Extension can be ignored for now. These errors are usually caused by extensions injecting
// scripts into the page, which we cannot control.
if
(
error
.
stack
?.
match
(
/chrome-extension:
\/\/
/i
))
return
null
// Errors coming from OneKey (a desktop wallet) can be ignored for now.
// These errors are either application-specific, or they will be thrown separately outside of OneKey.
if
(
error
.
stack
?.
match
(
/OneKey/i
))
return
null
...
...
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