Commit e0c8d74f authored by MozLando's avatar MozLando
Browse files

Merge #6206



6206: Closes #6204: GeneralError should not log as fatal r=rocketsroger a=jonalmeida



Co-authored-by: default avatarJonathan Almeida <jalmeida@mozilla.com>
parents 12200611 9918a738
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ import mozilla.appservices.push.AlreadyRegisteredError
import mozilla.appservices.push.CommunicationError
import mozilla.appservices.push.CommunicationServerError
import mozilla.appservices.push.CryptoError
import mozilla.appservices.push.GeneralError
import mozilla.appservices.push.MissingRegistrationTokenError
import mozilla.appservices.push.RecordNotFoundError
import mozilla.appservices.push.StorageError
@@ -356,6 +357,7 @@ internal fun CoroutineScope.launchAndTry(
            block()
        } catch (e: RustPushError) {
            val result = when (e) {
                is GeneralError,
                is CryptoError,
                is CommunicationError,
                is CommunicationServerError,
+6 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ import mozilla.appservices.push.AlreadyRegisteredError
import mozilla.appservices.push.CommunicationError
import mozilla.appservices.push.CommunicationServerError
import mozilla.appservices.push.CryptoError
import mozilla.appservices.push.GeneralError
import mozilla.appservices.push.InternalPanic
import mozilla.appservices.push.MissingRegistrationTokenError
import mozilla.appservices.push.RecordNotFoundError
@@ -96,5 +97,10 @@ class AutoPushFeatureKtTest {
            { throw UrlParseError("should not fail test") },
            { assert(true) }
        )

        CoroutineScope(coroutineContext).launchAndTry(
            { throw GeneralError("should not fail test") },
            { assert(true) }
        )
    }
}