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
607d0d44
Unverified
Commit
607d0d44
authored
May 01, 2023
by
Vignesh Mohankumar
Committed by
GitHub
May 01, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: filter errors with OneKey in stack (#6477)
* fix: filter errors with OneKey in stack * check stack
parent
ff0209a7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
errors.test.ts
src/tracing/errors.test.ts
+10
-3
errors.ts
src/tracing/errors.ts
+1
-1
No files found.
src/tracing/errors.test.ts
View file @
607d0d44
...
@@ -43,13 +43,20 @@ describe('filterKnownErrors', () => {
...
@@ -43,13 +43,20 @@ describe('filterKnownErrors', () => {
describe
(
'
OneKey
'
,
()
=>
{
describe
(
'
OneKey
'
,
()
=>
{
it
(
'
filter OneKey errors (macOS users)
'
,
()
=>
{
it
(
'
filter OneKey errors (macOS users)
'
,
()
=>
{
const
originalException
=
new
Error
()
const
originalException
=
new
Error
()
originalException
.
name
=
'
xd.<anonymous>(/Applications/OneKey.app/Contents/Resources/static/preload.js)
'
originalException
.
stack
=
`
SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse(<anonymous>)
at _d._handleAccountChange(/Applications/OneKey.app/Contents/Resources/static/preload.js:2:1634067)
`
expect
(
filterKnownErrors
(
ERROR
,
{
originalException
})).
toBeNull
()
expect
(
filterKnownErrors
(
ERROR
,
{
originalException
})).
toBeNull
()
})
})
it
(
'
filter OneKey errors (Windows users)
'
,
()
=>
{
it
(
'
filter OneKey errors (Windows users)
'
,
()
=>
{
const
originalException
=
new
Error
()
const
originalException
=
new
Error
()
originalException
.
name
=
originalException
.
stack
=
`
'
yd.<anonymous>(C:
\\
Users
\\
xyz
\\
AppData
\\
Local
\\
Programs
\\
OneKey
\\
resources
\\
static
\\
preload.js)
'
SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse(<anonymous>)
vd._handleAccountChange(C:\\Users\\example\\AppData\\Local\\Programs\\OneKey\\resources\\static\\preload.js:2:1626130
`
expect
(
filterKnownErrors
(
ERROR
,
{
originalException
})).
toBeNull
()
expect
(
filterKnownErrors
(
ERROR
,
{
originalException
})).
toBeNull
()
})
})
})
})
...
...
src/tracing/errors.ts
View file @
607d0d44
...
@@ -89,7 +89,7 @@ export const filterKnownErrors: Required<ClientOptions>['beforeSend'] = (event:
...
@@ -89,7 +89,7 @@ export const filterKnownErrors: Required<ClientOptions>['beforeSend'] = (event:
* 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.
*/
*/
if
(
error
.
name
.
match
(
/OneKey/i
))
return
null
if
(
error
.
stack
?
.
match
(
/OneKey/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.
...
...
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