Catch OOM on ROOM compute call

pull/187/head
M66B 4 years ago
parent 18d2428f8e
commit 1459e89ea5

@ -92,7 +92,7 @@ class RoomTrackingLiveData<T> extends LiveData<T> {
try { try {
value = mComputeFunction.call(); value = mComputeFunction.call();
done = true; done = true;
} catch (Exception e) { } catch (Throwable e) {
if (++retry > 10) if (++retry > 10)
throw new RuntimeException( throw new RuntimeException(
"Exception while computing database live data.", e); "Exception while computing database live data.", e);

@ -15,7 +15,7 @@
+ try { + try {
+ value = mComputeFunction.call(); + value = mComputeFunction.call();
+ done = true; + done = true;
+ } catch (Exception e) { + } catch (Throwable e) {
+ if (++retry > 10) + if (++retry > 10)
+ throw new RuntimeException( + throw new RuntimeException(
+ "Exception while computing database live data.", e); + "Exception while computing database live data.", e);

Loading…
Cancel
Save