Commit 6d60aca4 authored by Vignesh Mohankumar's avatar Vignesh Mohankumar Committed by GitHub

fix: filter OneKey related errors (#6396)

* fix: filter OneKey related errors

* fix

* .app
parent c77885c4
...@@ -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()
......
...@@ -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.
......
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