Misc fixes
This commit is contained in:
@@ -6,6 +6,7 @@ import be.mygod.vpnhotspot.net.Routing.Companion.IP
|
||||
import be.mygod.vpnhotspot.root.RoutingCommands
|
||||
import be.mygod.vpnhotspot.util.RootSession
|
||||
import be.mygod.vpnhotspot.widget.SmartSnackbar
|
||||
import kotlinx.coroutines.CancellationException
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
@@ -40,6 +41,7 @@ object DhcpWorkaround : SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
SmartSnackbar.make(e).show()
|
||||
}
|
||||
}
|
||||
} catch (_: CancellationException) {
|
||||
} catch (e: Exception) {
|
||||
Timber.w(e)
|
||||
SmartSnackbar.make(e).show()
|
||||
|
||||
@@ -17,6 +17,7 @@ import be.mygod.vpnhotspot.util.RootSession
|
||||
import be.mygod.vpnhotspot.util.if_nametoindex
|
||||
import be.mygod.vpnhotspot.util.parseNumericAddress
|
||||
import be.mygod.vpnhotspot.widget.SmartSnackbar
|
||||
import kotlinx.coroutines.CancellationException
|
||||
import timber.log.Timber
|
||||
import java.io.BufferedWriter
|
||||
import java.io.IOException
|
||||
@@ -340,7 +341,9 @@ class Routing(private val caller: Any, private val downstream: String) : IpNeigh
|
||||
currentDns?.transaction?.revert()
|
||||
currentDns = if (ifindex == 0 || dns == null) null else try {
|
||||
DnsRoute(ifindex, dns)
|
||||
} catch (e: RuntimeException) {
|
||||
} catch (_: CancellationException) {
|
||||
null
|
||||
} catch (e: Exception) {
|
||||
Timber.w(e)
|
||||
SmartSnackbar.make(e).show()
|
||||
null
|
||||
|
||||
Reference in New Issue
Block a user