Log OAuth token errors

This commit is contained in:
M66B 2022-08-16 12:34:43 +02:00
parent 06700fd3ff
commit 467b364d5d
2 changed files with 5 additions and 2 deletions

View File

@ -122,7 +122,8 @@ public class GmailState {
if (newToken != null && !newToken.equals(token)) {
token = newToken;
acquired = new Date().getTime();
}
} else
Log.e("Token refresh failed id=" + id + " token=" + (token != null));
if (token == null)
throw new AuthenticatorException("No token for " + id + ":" + user);

View File

@ -219,8 +219,10 @@ public class ServiceAuthenticator extends Authenticator {
semaphore.acquire();
Log.i("OAuth refreshed user=" + id + ":" + user);
if (holder.error != null)
if (holder.error != null) {
Log.e(new Throwable("Token refresh failed id=" + id, holder.error));
throw holder.error;
}
} catch (Exception ex) {
throw new MessagingException("OAuth refresh id=" + id, ex);
}