ErrorMessages: do not traverse down into remote exceptions

Otherwise we miss the actual error message.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2020-03-09 00:19:56 +08:00
parent 4905185e61
commit 453a1aaa65

View File

@ -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;
}