From 453a1aaa6523c19697b6463d492bc54346e89690 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 9 Mar 2020 00:19:56 +0800 Subject: ErrorMessages: do not traverse down into remote exceptions Otherwise we miss the actual error message. Signed-off-by: Jason A. Donenfeld --- app/src/main/java/com/wireguard/android/util/ErrorMessages.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/src/main/java/com/wireguard/android') 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; } -- cgit v1.2.3