summaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-03-09 01:06:14 +0800
committerJason A. Donenfeld <Jason@zx2c4.com>2020-03-09 01:28:41 +0800
commit183973066328f7203ef799a4c4597832d8ffa7de (patch)
tree6d22044c84074214c5f608eb23fa5430b22433af /app
parentafd75cc4cf7dc59a4d31a133b56d6e045bbe8786 (diff)
ModuleDownloaderPreference: properly use errormessages
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/com/wireguard/android/backend/BackendException.java1
-rw-r--r--app/src/main/java/com/wireguard/android/preference/ModuleDownloaderPreference.java3
2 files changed, 2 insertions, 2 deletions
diff --git a/app/src/main/java/com/wireguard/android/backend/BackendException.java b/app/src/main/java/com/wireguard/android/backend/BackendException.java
index 2994e02a..e1e8eaa9 100644
--- a/app/src/main/java/com/wireguard/android/backend/BackendException.java
+++ b/app/src/main/java/com/wireguard/android/backend/BackendException.java
@@ -14,7 +14,6 @@ public final class BackendException extends Exception {
UNABLE_TO_START_VPN,
TUN_CREATION_ERROR,
GO_ACTIVATION_ERROR_CODE
-
}
private final Reason reason;
private final Object[] format;
diff --git a/app/src/main/java/com/wireguard/android/preference/ModuleDownloaderPreference.java b/app/src/main/java/com/wireguard/android/preference/ModuleDownloaderPreference.java
index a04bed76..aac649dd 100644
--- a/app/src/main/java/com/wireguard/android/preference/ModuleDownloaderPreference.java
+++ b/app/src/main/java/com/wireguard/android/preference/ModuleDownloaderPreference.java
@@ -13,6 +13,7 @@ import android.widget.Toast;
import com.wireguard.android.Application;
import com.wireguard.android.R;
+import com.wireguard.android.util.ErrorMessages;
import com.wireguard.android.util.ModuleLoader;
import com.wireguard.android.util.ToolsInstaller;
@@ -45,7 +46,7 @@ public class ModuleDownloaderPreference extends Preference {
private void onDownloadResult(final Integer result, @Nullable final Throwable throwable) {
if (throwable != null) {
setState(State.FAILURE);
- Toast.makeText(getContext(), throwable.getMessage(), Toast.LENGTH_LONG).show();
+ Toast.makeText(getContext(), ErrorMessages.get(throwable), Toast.LENGTH_LONG).show();
} else if (result == OsConstants.ENOENT)
setState(State.NOTFOUND);
else if (result == OsConstants.EXIT_SUCCESS) {