Loading components/feature/addons/src/main/java/mozilla/components/feature/addons/worker/Extensions.kt +2 −1 Original line number Diff line number Diff line Loading @@ -9,4 +9,5 @@ import kotlinx.coroutines.CancellationException /** * Indicates if an exception should be reported to the crash reporter. */ internal fun Exception.shouldReport(): Boolean = cause !is IOException && cause !is CancellationException internal fun Exception.shouldReport(): Boolean = cause !is IOException && cause !is CancellationException && this !is CancellationException components/feature/addons/src/test/java/mozilla/components/feature/addons/worker/ExtensionsTest.kt +5 −0 Original line number Diff line number Diff line Loading @@ -23,4 +23,9 @@ class ExtensionsTest { fun `shouldReport - when cause is a CancellationException must NOT be reported`() { assertFalse(Exception(CancellationException()).shouldReport()) } @Test fun `shouldReport - when cause the exception is a CancellationException must NOT be reported`() { assertFalse(CancellationException().shouldReport()) } } Loading
components/feature/addons/src/main/java/mozilla/components/feature/addons/worker/Extensions.kt +2 −1 Original line number Diff line number Diff line Loading @@ -9,4 +9,5 @@ import kotlinx.coroutines.CancellationException /** * Indicates if an exception should be reported to the crash reporter. */ internal fun Exception.shouldReport(): Boolean = cause !is IOException && cause !is CancellationException internal fun Exception.shouldReport(): Boolean = cause !is IOException && cause !is CancellationException && this !is CancellationException
components/feature/addons/src/test/java/mozilla/components/feature/addons/worker/ExtensionsTest.kt +5 −0 Original line number Diff line number Diff line Loading @@ -23,4 +23,9 @@ class ExtensionsTest { fun `shouldReport - when cause is a CancellationException must NOT be reported`() { assertFalse(Exception(CancellationException()).shouldReport()) } @Test fun `shouldReport - when cause the exception is a CancellationException must NOT be reported`() { assertFalse(CancellationException().shouldReport()) } }