From 95b411f5c2cca8461867ff56dc82c0b006a9d5ae Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 18 May 2022 09:46:05 +0200 Subject: [PATCH] Revert "Handle provider not found" This reverts commit fdce403c26af8ef5109f69ddbebcd7e81488c981. --- app/src/main/java/eu/faircode/email/EmailService.java | 3 --- .../main/java/eu/faircode/email/ServiceAuthenticator.java | 5 +---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/EmailService.java b/app/src/main/java/eu/faircode/email/EmailService.java index a9393520ee..66dcf28804 100644 --- a/app/src/main/java/eu/faircode/email/EmailService.java +++ b/app/src/main/java/eu/faircode/email/EmailService.java @@ -47,7 +47,6 @@ import com.sun.mail.util.SocketConnectException; import com.sun.mail.util.TraceOutputStream; import java.io.ByteArrayOutputStream; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.OutputStream; import java.io.PrintStream; @@ -457,8 +456,6 @@ public class EmailService implements AutoCloseable { try { authenticator.refreshToken(true); connect(host, port, auth, user, factory); - } catch (FileNotFoundException ex1) { - throw new AuthenticationFailedException(ex1.getMessage(), ex1); } catch (Exception ex1) { Log.e(ex1); String msg = ex.getMessage(); diff --git a/app/src/main/java/eu/faircode/email/ServiceAuthenticator.java b/app/src/main/java/eu/faircode/email/ServiceAuthenticator.java index da926adf04..5749bb0320 100644 --- a/app/src/main/java/eu/faircode/email/ServiceAuthenticator.java +++ b/app/src/main/java/eu/faircode/email/ServiceAuthenticator.java @@ -34,7 +34,6 @@ import net.openid.appauth.NoClientAuthentication; import org.json.JSONException; -import java.io.FileNotFoundException; import java.io.IOException; import java.util.Date; import java.util.Objects; @@ -147,7 +146,7 @@ public class ServiceAuthenticator extends Authenticator { } private static void OAuthRefresh(Context context, String id, AuthState authState, boolean expire, long keep_alive) - throws FileNotFoundException, MessagingException { + throws MessagingException { try { Long expiration = authState.getAccessTokenExpirationTime(); if (expiration != null && expiration - keep_alive < new Date().getTime()) { @@ -189,8 +188,6 @@ public class ServiceAuthenticator extends Authenticator { if (holder.error != null) throw holder.error; - } catch (FileNotFoundException ex) { - throw ex; // provider not found } catch (Exception ex) { throw new MessagingException("OAuth refresh id=" + id, ex); }