[components] Closes https://github.com/mozilla-mobile/android-components/issues/5677: Catch all known non-fatal push errors

Previously, we wanted to throw on all unknown push errors so that we
were notified on them. Since this seems to be more common than
originally expected, we should just catch them and in a future version,
we should log them without crashing.

All of these push errors can be considered recoverable except
for InternalPanic.
This commit is contained in:
Jonathan Almeida
2020-01-22 12:28:47 -05:00
parent 7f11f02e1d
commit 81640524f0
7 changed files with 113 additions and 32 deletions

View File

@@ -95,7 +95,7 @@ class AbstractAmazonPushServiceTest {
verify(processor).onError(captor.capture())
assertTrue(captor.value is PushError.Registration)
assertTrue(captor.value.desc.contains("registration failed"))
assertTrue(captor.value.message.contains("registration failed"))
}
@Test
@@ -111,7 +111,7 @@ class AbstractAmazonPushServiceTest {
verify(processor).onError(captor.capture())
assertTrue(captor.value is PushError.MalformedMessage)
assertTrue(captor.value.desc.contains("NoSuchElementException"))
assertTrue(captor.value.message.contains("NoSuchElementException"))
}
@Test