fix(spoof): wrap pollOnce in umbrella try/catch
fetchAndParse and appendHistory each catch their own exceptions, but scheduleNext can throw IllegalStateException if the Looper is torn down or any helper raises an unanticipated error. Without an outer catch, the reschedule chain broke and the poller stayed dead until reboot. Wrap the entire body so a thrown exception still attempts to schedule the next poll.
This commit is contained in:
@@ -36,9 +36,14 @@ object BulletinPoller {
|
||||
}
|
||||
|
||||
private fun pollOnce() {
|
||||
try {
|
||||
val result = fetchAndParse()
|
||||
appendHistory(result)
|
||||
scheduleNext(result.status == "success")
|
||||
} catch (t: Throwable) {
|
||||
SystemLogger.error("BulletinPoller: pollOnce failed", t)
|
||||
scheduleNext(false)
|
||||
}
|
||||
}
|
||||
|
||||
private fun scheduleNext(success: Boolean) {
|
||||
|
||||
Reference in New Issue
Block a user