Handle OOM for whatever reasons

This commit is contained in:
Mygod
2019-07-11 16:14:06 +08:00
parent 9a69c4006e
commit 4860ca03e7

View File

@@ -57,15 +57,15 @@ object MacLookup {
nickname = result nickname = result
macLookupPending = false macLookupPending = false
} }
} catch (e: Exception) {
Timber.d(e)
if (explicit) SmartSnackbar.make(e).show()
} catch (e: JSONException) { } catch (e: JSONException) {
if ((e as? UnexpectedError)?.error == "no result") { if ((e as? UnexpectedError)?.error == "no result") {
// no vendor found, we should not retry in the future // no vendor found, we should not retry in the future
AppDatabase.instance.clientRecordDao.upsert(mac) { macLookupPending = false } AppDatabase.instance.clientRecordDao.upsert(mac) { macLookupPending = false }
} else Timber.w(e) } else Timber.w(e)
if (explicit) SmartSnackbar.make(e).show() if (explicit) SmartSnackbar.make(e).show()
} catch (e: Throwable) {
Timber.d(e)
if (explicit) SmartSnackbar.make(e).show()
} }
} }
} }