summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-03-09 00:19:56 +0800
committerJason A. Donenfeld <Jason@zx2c4.com>2020-03-09 00:19:56 +0800
commit453a1aaa6523c19697b6463d492bc54346e89690 (patch)
tree2c73e9bf230107d84533f9720c8c8e210f71ea3b
parent4905185e6121471f8c15d4ac59623323284135e5 (diff)
ErrorMessages: do not traverse down into remote exceptions
Otherwise we miss the actual error message. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--app/src/main/java/com/wireguard/android/util/ErrorMessages.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/src/main/java/com/wireguard/android/util/ErrorMessages.java b/app/src/main/java/com/wireguard/android/util/ErrorMessages.java
index ee9cb12a..7f926541 100644
--- a/app/src/main/java/com/wireguard/android/util/ErrorMessages.java
+++ b/app/src/main/java/com/wireguard/android/util/ErrorMessages.java
@@ -6,6 +6,8 @@
package com.wireguard.android.util;
import android.content.res.Resources;
+import android.os.RemoteException;
+
import androidx.annotation.Nullable;
import com.wireguard.android.Application;
@@ -123,7 +125,10 @@ public final class ErrorMessages {
while (cause.getCause() != null) {
if (cause instanceof BadConfigException)
break;
- cause = cause.getCause();
+ final Throwable nextCause = cause.getCause();
+ if (nextCause instanceof RemoteException)
+ break;
+ cause = nextCause;
}
return cause;
}