mirror of https://github.com/M66B/FairEmail.git
Improved auth failed error message
This commit is contained in:
parent
40eedcb4dd
commit
d5dbb47948
|
@ -494,10 +494,20 @@ public class EmailService implements AutoCloseable {
|
|||
Log.e(ex1);
|
||||
else
|
||||
Log.e(new Throwable(ex1.getMessage() + " error=" + cause.getMessage(), ex1));
|
||||
|
||||
String msg = ex.getMessage();
|
||||
if (auth == AUTH_TYPE_GMAIL &&
|
||||
msg != null && msg.endsWith("Invalid credentials (Failure)"))
|
||||
msg += "; " + context.getString(R.string.title_service_token);
|
||||
msg += "\n" + context.getString(R.string.title_service_token);
|
||||
|
||||
Throwable c = ex1;
|
||||
while (c != null) {
|
||||
String m = c.getMessage();
|
||||
if (!TextUtils.isEmpty(m))
|
||||
msg += "\n" + m;
|
||||
c = c.getCause();
|
||||
}
|
||||
|
||||
throw new AuthenticationFailedException(
|
||||
context.getString(R.string.title_service_auth, msg),
|
||||
ex.getNextException());
|
||||
|
|
Loading…
Reference in New Issue