More informative unexpected output exception
This commit is contained in:
@@ -5,6 +5,7 @@ import be.mygod.vpnhotspot.App.Companion.app
|
||||
import be.mygod.vpnhotspot.util.RootSession
|
||||
import be.mygod.vpnhotspot.widget.SmartSnackbar
|
||||
import timber.log.Timber
|
||||
import java.io.IOException
|
||||
|
||||
/**
|
||||
* Assuming RULE_PRIORITY_VPN_OUTPUT_TO_LOCAL = 11000.
|
||||
@@ -33,7 +34,7 @@ object DhcpWorkaround : SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
} else {
|
||||
e.result.err.joinToString("\n") == "RTNETLINK answers: No such file or directory"
|
||||
}) return
|
||||
Timber.w(e)
|
||||
Timber.w(IOException("Failed to tweak dhcp workaround rule", e))
|
||||
SmartSnackbar.make(e).show()
|
||||
} catch (e: Exception) {
|
||||
Timber.w(e)
|
||||
|
||||
@@ -13,6 +13,7 @@ import be.mygod.vpnhotspot.util.computeIfAbsentCompat
|
||||
import be.mygod.vpnhotspot.widget.SmartSnackbar
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import timber.log.Timber
|
||||
import java.io.IOException
|
||||
import java.net.*
|
||||
|
||||
/**
|
||||
@@ -238,7 +239,7 @@ class Routing(private val caller: Any, private val downstream: String) : IpNeigh
|
||||
"ndc ipfwd disable vpnhotspot_$downstream")
|
||||
return
|
||||
} catch (e: RootSession.UnexpectedOutputException) {
|
||||
Timber.w(e)
|
||||
Timber.w(IOException("ndc ipfwd enable failure", e))
|
||||
}
|
||||
transaction.exec("echo 1 >/proc/sys/net/ipv4/ip_forward")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user