diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-03-09 01:06:14 +0800 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-03-09 01:28:41 +0800 |
commit | bd6d0467131fd8d14d6881a7f0d26fe4448275ac (patch) | |
tree | 6d22044c84074214c5f608eb23fa5430b22433af | |
parent | 9836394a75be6c06ac9378d3ea4af51268622e13 (diff) |
ModuleDownloaderPreference: properly use errormessages
-rw-r--r-- | app/src/main/java/com/wireguard/android/backend/BackendException.java | 1 | ||||
-rw-r--r-- | app/src/main/java/com/wireguard/android/preference/ModuleDownloaderPreference.java | 3 |
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) { |