From 2c5d24f024e4972fe20670594b3ed5ab38eeac4e Mon Sep 17 00:00:00 2001
From: pacien
Date: Wed, 14 Mar 2018 13:30:11 +0100
Subject: Handle network interface binding errors
---
app/src/main/java/org/pacien/tincapp/service/TincVpnService.kt | 4 ++++
app/src/main/res/values/strings.xml | 2 ++
2 files changed, 6 insertions(+)
diff --git a/app/src/main/java/org/pacien/tincapp/service/TincVpnService.kt b/app/src/main/java/org/pacien/tincapp/service/TincVpnService.kt
index b59be80..0bf72a1 100644
--- a/app/src/main/java/org/pacien/tincapp/service/TincVpnService.kt
+++ b/app/src/main/java/org/pacien/tincapp/service/TincVpnService.kt
@@ -79,6 +79,10 @@ class TincVpnService : VpnService() {
.establish()!!
} catch (e: IllegalArgumentException) {
return reportError(resources.getString(R.string.message_network_config_invalid_format, e.message!!), e, "network-interface")
+ } catch (e: IllegalStateException) {
+ return reportError(resources.getString(R.string.message_could_not_configure_iface, e.message!!), e)
+ } catch (e: NullPointerException) {
+ return reportError(resources.getString(R.string.message_could_not_bind_iface), e)
}
val privateKeys = try {
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 6dfcfb7..25bee44 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -86,6 +86,8 @@
Loading…
Log level set to %1$d.
Logging paused.
+ Could not apply network interface configuration:\n\n%1$s
+ Could not bind network interface. Is another VPN running?
none
yes
--
cgit v1.2.3