Commit 82e7925a authored by Vignesh Mohankumar's avatar Vignesh Mohankumar Committed by GitHub

fix: properly filter AbortErrors (#6519)

* fix: properly filter AbortErrors

* lol
parent 2150347b
...@@ -152,7 +152,7 @@ describe('filterKnownErrors', () => { ...@@ -152,7 +152,7 @@ describe('filterKnownErrors', () => {
}) })
it('filters AbortErrors', () => { it('filters AbortErrors', () => {
const originalException = new Error('AbortError: The user aborted a request.') const originalException = new DOMException('The user aborted a request.', 'AbortError')
expect(filterKnownErrors(ERROR, { originalException })).toBeNull() expect(filterKnownErrors(ERROR, { originalException })).toBeNull()
}) })
}) })
...@@ -110,7 +110,7 @@ export const filterKnownErrors: Required<ClientOptions>['beforeSend'] = (event: ...@@ -110,7 +110,7 @@ export const filterKnownErrors: Required<ClientOptions>['beforeSend'] = (event:
} }
// These are caused by user navigation away from the page before a request has finished. // These are caused by user navigation away from the page before a request has finished.
if (error.message.startsWith('AbortError')) return null if (error instanceof DOMException && error.name === 'AbortError') return null
} }
return event return event
......
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