From f23894674d10eba97c62b5564b5915227ee7f81d Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 12 Nov 2022 13:53:52 +0100 Subject: [PATCH] Improved logging --- app/src/main/java/eu/faircode/email/EmailService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/EmailService.java b/app/src/main/java/eu/faircode/email/EmailService.java index c86eb1c361..a63f49b222 100644 --- a/app/src/main/java/eu/faircode/email/EmailService.java +++ b/app/src/main/java/eu/faircode/email/EmailService.java @@ -481,7 +481,11 @@ public class EmailService implements AutoCloseable { authenticator.refreshToken(true); connect(host, port, auth, user, factory); } catch (Exception ex1) { - Log.e(ex1); + Throwable cause = ex1.getCause(); + if (cause == null) + Log.e(ex1); + else + Log.e(new Throwable(ex1.getMessage() + " error=" + cause.getMessage(), ex1)); String msg = ex.getMessage(); if (auth == AUTH_TYPE_GMAIL && msg != null && msg.endsWith("Invalid credentials (Failure)"))