Commit 50d3d3c8 authored by MozLando's avatar MozLando
Browse files

Merge #6821



6821: Closes #6820 Ignore JobCancellationExceptions in add-ons workers r=csadilek a=Amejia481



Co-authored-by: default avatarArturo Mejia <arturomejiamarmol@gmail.com>
parents ece50c45 8360ac8b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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
+5 −0
Original line number Diff line number Diff line
@@ -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())
    }
}