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
commit258a99309daaf1c3f5b2ebca182ffe51c37ce0f6 (patch)
tree2c73e9bf230107d84533f9720c8c8e210f71ea3b
parent7c60a0c764fcebb115de61cd1c8e35d34245e972 (diff)
ErrorMessages: do not traverse down into remote exceptions
Otherwise we miss the actual error message.
-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;
}