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
8d32e315
Unverified
Commit
8d32e315
authored
Jun 15, 2023
by
Vignesh Mohankumar
Committed by
GitHub
Jun 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: filter moz-extension errors (#6781)
parent
1c8b3f03
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
11 deletions
+23
-11
errors.test.ts
src/tracing/errors.test.ts
+21
-9
errors.ts
src/tracing/errors.ts
+2
-2
No files found.
src/tracing/errors.test.ts
View file @
8d32e315
...
@@ -76,6 +76,7 @@ describe('beforeSend', () => {
...
@@ -76,6 +76,7 @@ describe('beforeSend', () => {
expect
(
beforeSend
(
ERROR
,
{
originalException
})).
toBeNull
()
expect
(
beforeSend
(
ERROR
,
{
originalException
})).
toBeNull
()
})
})
describe
(
'
filters browser extension errors
'
,
()
=>
{
it
(
'
filters chrome-extension errors
'
,
()
=>
{
it
(
'
filters chrome-extension errors
'
,
()
=>
{
const
originalException
=
new
Error
()
const
originalException
=
new
Error
()
originalException
.
stack
=
`
originalException
.
stack
=
`
...
@@ -87,6 +88,17 @@ describe('beforeSend', () => {
...
@@ -87,6 +88,17 @@ describe('beforeSend', () => {
expect
(
beforeSend
(
ERROR
,
{
originalException
})).
toBeNull
()
expect
(
beforeSend
(
ERROR
,
{
originalException
})).
toBeNull
()
})
})
it
(
'
filters moz-extension errors
'
,
()
=>
{
const
originalException
=
new
Error
()
originalException
.
stack
=
`
Error: Permission denied to access property "apply"
at WINDOW.onunhandledrejection(../node_modules/@sentry/src/instrument.ts:610:1)
at y/h.onunhandledrejection(moz-extension://95cafb7b-6038-4bdd-b832-d3a58544601d/content_script/inpage_sol.js:143:16274)
`
expect
(
beforeSend
(
ERROR
,
{
originalException
})).
toBeNull
()
})
})
describe
(
'
OneKey
'
,
()
=>
{
describe
(
'
OneKey
'
,
()
=>
{
it
(
'
filter OneKey errors (macOS users)
'
,
()
=>
{
it
(
'
filter OneKey errors (macOS users)
'
,
()
=>
{
const
originalException
=
new
Error
()
const
originalException
=
new
Error
()
...
...
src/tracing/errors.ts
View file @
8d32e315
...
@@ -58,9 +58,9 @@ function shouldRejectError(error: EventHint['originalException']) {
...
@@ -58,9 +58,9 @@ function shouldRejectError(error: EventHint['originalException']) {
// Therefore, this can be ignored.
// Therefore, this can be ignored.
if
(
error
.
message
.
match
(
/Unexpected token '<'/
))
return
true
if
(
error
.
message
.
match
(
/Unexpected token '<'/
))
return
true
// Errors coming from a
Chrome Extension can be ignored for now
. These errors are usually caused by extensions injecting
// Errors coming from a
browser extension can be ignored
. These errors are usually caused by extensions injecting
// scripts into the page, which we cannot control.
// scripts into the page, which we cannot control.
if
(
error
.
stack
?.
match
(
/
chrome
-extension:
\/\/
/i
))
return
true
if
(
error
.
stack
?.
match
(
/-extension:
\/\/
/i
))
return
true
// Errors coming from OneKey (a desktop wallet) can be ignored for now.
// 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.
// These errors are either application-specific, or they will be thrown separately outside of OneKey.
...
...
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