Log OAuth token errors

pull/209/head
M66B 2 years ago
parent 06700fd3ff
commit 467b364d5d

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

@ -219,8 +219,10 @@ public class ServiceAuthenticator extends Authenticator {
semaphore.acquire(); semaphore.acquire();
Log.i("OAuth refreshed user=" + id + ":" + user); 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; throw holder.error;
}
} catch (Exception ex) { } catch (Exception ex) {
throw new MessagingException("OAuth refresh id=" + id, ex); throw new MessagingException("OAuth refresh id=" + id, ex);
} }

Loading…
Cancel
Save