From 2cce339063f706fe33a90be66170e5ed056d12c6 Mon Sep 17 00:00:00 2001 From: Mygod Date: Sun, 12 Jul 2020 07:10:40 +0800 Subject: [PATCH] Suppress CancellationException --- .../java/be/mygod/vpnhotspot/net/monitor/TrafficRecorder.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/TrafficRecorder.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/TrafficRecorder.kt index 17a26a80..a205d8e5 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/TrafficRecorder.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/TrafficRecorder.kt @@ -135,7 +135,8 @@ object TrafficRecorder { if (!timeout && timestamp - lastUpdate <= 100) return try { doUpdate(timestamp) - } catch (e: RuntimeException) { + } catch (_: CancellationException) { + } catch (e: Exception) { Timber.w(e) SmartSnackbar.make(e).show() }