Make LiveRecipientCache throw exceptions instead of errors.

Errors were causing crash loops if they occur in a job. This will still
allow the app to crash, but prevent loops.
This commit is contained in:
Greyson Parrelli
2020-05-04 00:48:09 -04:00
parent e00f8c94ff
commit c59fc3581a
2 changed files with 8 additions and 10 deletions

View File

@@ -400,7 +400,7 @@ public class RecipientDatabase extends Database {
if (cursor != null && cursor.moveToNext()) {
return getRecipientSettings(context, cursor);
} else {
throw new MissingRecipientError(id);
throw new MissingRecipientException(id);
}
}
}
@@ -1928,8 +1928,8 @@ public class RecipientDatabase extends Database {
}
}
public static class MissingRecipientError extends AssertionError {
public MissingRecipientError(@Nullable RecipientId id) {
public static class MissingRecipientException extends IllegalStateException {
public MissingRecipientException(@Nullable RecipientId id) {
super("Failed to find recipient with ID: " + id);
}
}