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
6d60aca4
Unverified
Commit
6d60aca4
authored
Apr 26, 2023
by
Vignesh Mohankumar
Committed by
GitHub
Apr 26, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: filter OneKey related errors (#6396)
* fix: filter OneKey related errors * fix * .app
parent
c77885c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
errors.test.ts
src/tracing/errors.test.ts
+6
-0
errors.ts
src/tracing/errors.ts
+6
-0
No files found.
src/tracing/errors.test.ts
View file @
6d60aca4
...
@@ -40,6 +40,12 @@ describe('filterKnownErrors', () => {
...
@@ -40,6 +40,12 @@ describe('filterKnownErrors', () => {
expect
(
filterKnownErrors
(
ERROR
,
{
originalException
})).
toBeNull
()
expect
(
filterKnownErrors
(
ERROR
,
{
originalException
})).
toBeNull
()
})
})
it
(
'
filter errors from OneKey app
'
,
()
=>
{
const
originalException
=
new
Error
()
originalException
.
name
=
'
xd.<anonymous>(/Applications/OneKey.app/Contents/Resources/static/preload.js)
'
expect
(
filterKnownErrors
(
ERROR
,
{
originalException
})).
toBe
(
null
)
})
describe
(
'
chunk errors
'
,
()
=>
{
describe
(
'
chunk errors
'
,
()
=>
{
afterEach
(()
=>
{
afterEach
(()
=>
{
jest
.
restoreAllMocks
()
jest
.
restoreAllMocks
()
...
...
src/tracing/errors.ts
View file @
6d60aca4
...
@@ -85,6 +85,12 @@ export const filterKnownErrors: Required<ClientOptions>['beforeSend'] = (event:
...
@@ -85,6 +85,12 @@ export const filterKnownErrors: Required<ClientOptions>['beforeSend'] = (event:
*/
*/
if
(
error
.
message
.
match
(
/Unexpected token '<'/
))
return
null
if
(
error
.
message
.
match
(
/Unexpected token '<'/
))
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
.
name
.
match
(
/OneKey
\.
app/i
))
return
null
/*
/*
* Content security policy 'unsafe-eval' errors can be filtered out because there are expected failures.
* Content security policy 'unsafe-eval' errors can be filtered out because there are expected failures.
* For example, if a user runs an eval statement in console this error would still get thrown.
* For example, if a user runs an eval statement in console this error would still get thrown.
...
...
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