Commit 97312bb1 authored by Vignesh Mohankumar's avatar Vignesh Mohankumar Committed by GitHub

fix: match OneKey more generically (#6461)

* fix: match OneKey more generically

* flip

* Update src/tracing/errors.test.ts
Co-authored-by: default avatarZach Pomerantz <zzmp@uniswap.org>

* Update src/tracing/errors.test.ts
Co-authored-by: default avatarZach Pomerantz <zzmp@uniswap.org>

* Update src/tracing/errors.test.ts
Co-authored-by: default avatarZach Pomerantz <zzmp@uniswap.org>

* backslashes

* fix

---------
parent d0a10fcf
......@@ -40,10 +40,18 @@ describe('filterKnownErrors', () => {
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('OneKey', () => {
it('filter OneKey errors (macOS users)', () => {
const originalException = new Error()
originalException.name = 'xd.<anonymous>(/Applications/OneKey.app/Contents/Resources/static/preload.js)'
expect(filterKnownErrors(ERROR, { originalException })).toBeNull()
})
it('filter OneKey errors (Windows users)', () => {
const originalException = new Error()
originalException.name =
'yd.<anonymous>(C:\\Users\\xyz\\AppData\\Local\\Programs\\OneKey\\resources\\static\\preload.js)'
expect(filterKnownErrors(ERROR, { originalException })).toBeNull()
})
})
describe('chunk errors', () => {
......
......@@ -89,7 +89,7 @@ export const filterKnownErrors: Required<ClientOptions>['beforeSend'] = (event:
* 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
if (error.name.match(/OneKey/i)) return null
/*
* Content security policy 'unsafe-eval' errors can be filtered out because there are expected failures.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment