From 81f9e16a4b5c573f43cd24c2d235730ffc849292 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 22 Sep 2020 20:05:39 +0200 Subject: [PATCH] Prefer auth exception --- .../main/java/eu/faircode/email/FragmentQuickSetup.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentQuickSetup.java b/app/src/main/java/eu/faircode/email/FragmentQuickSetup.java index 04b0fe3b48..b383233ef6 100644 --- a/app/src/main/java/eu/faircode/email/FragmentQuickSetup.java +++ b/app/src/main/java/eu/faircode/email/FragmentQuickSetup.java @@ -317,6 +317,7 @@ public class FragmentQuickSetup extends FragmentBase { } else throw ex; } catch (Throwable ex) { + Log.w(ex); // Why not AuthenticationFailedException? // Some providers terminate the connection with an invalid username if (user.equals(username)) @@ -332,7 +333,11 @@ public class FragmentQuickSetup extends FragmentBase { null, null); } catch (Throwable ex1) { Log.w(ex1); - throw ex; + if (!(ex instanceof AuthenticationFailedException) && + ex1 instanceof AuthenticationFailedException) + throw ex1; + else + throw ex; } }