From b330518620e913309cde5de0e6dd267b0e2d2cca Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 30 Mar 2020 13:06:47 +0200 Subject: [PATCH] Fixed fallback with authentication error --- app/src/main/java/eu/faircode/email/EmailService.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/EmailService.java b/app/src/main/java/eu/faircode/email/EmailService.java index c5c50c8abf..2bd3d0e00e 100644 --- a/app/src/main/java/eu/faircode/email/EmailService.java +++ b/app/src/main/java/eu/faircode/email/EmailService.java @@ -386,7 +386,8 @@ public class EmailService implements AutoCloseable { } if (ioError) { - EntityLog.log(context, "Connect ex=" + ex.getMessage()); + EntityLog.log(context, "Connect ex=" + + ex.getClass().getName() + ":" + ex.getMessage()); try { // Some devices resolve IPv6 addresses while not having IPv6 connectivity InetAddress[] iaddrs = InetAddress.getAllByName(host); @@ -438,11 +439,13 @@ public class EmailService implements AutoCloseable { _connect(iaddr.getHostAddress(), port, user, password, factory); return; } catch (MessagingException ex1) { - EntityLog.log(context, "Fallback ex=" + ex1.getMessage()); + ex = ex1; + EntityLog.log(context, "Fallback ex=" + + ex1.getClass().getName() + ":" + ex1.getMessage()); } } - } catch (Throwable ex1) { - Log.w(ex1); + } catch (IOException ex1) { + throw new MessagingException(ex1.getMessage(), ex1); } }