Added connection breadcrumbs

pull/209/head
M66B 2 years ago
parent acaa16fe1e
commit dba78b75c4

@ -526,6 +526,11 @@ public class EmailService implements AutoCloseable {
private void connect( private void connect(
String host, int port, int auth, String user, String host, int port, int auth, String user,
SSLSocketFactoryService factory) throws MessagingException { SSLSocketFactoryService factory) throws MessagingException {
Map<String, String> crumb = new HashMap<>();
crumb.put("host", host);
crumb.put("port", Integer.toString(port));
crumb.put("auth", Integer.toString(auth));
InetAddress main = null; InetAddress main = null;
boolean require_id = (purpose == PURPOSE_CHECK && boolean require_id = (purpose == PURPOSE_CHECK &&
auth == AUTH_TYPE_OAUTH && auth == AUTH_TYPE_OAUTH &&
@ -569,10 +574,17 @@ public class EmailService implements AutoCloseable {
} }
} }
Log.breadcrumb("Connecting", crumb);
_connect(main, port, require_id, user, factory); _connect(main, port, require_id, user, factory);
Log.breadcrumb("Connected", crumb);
} catch (UnknownHostException ex) { } catch (UnknownHostException ex) {
crumb.put("exception", ex + "\n" + android.util.Log.getStackTraceString(ex));
Log.breadcrumb("Connection failed", crumb);
throw new MessagingException(ex.getMessage(), ex); throw new MessagingException(ex.getMessage(), ex);
} catch (MessagingException ex) { } catch (MessagingException ex) {
crumb.put("exception", ex + "\n" + android.util.Log.getStackTraceString(ex));
Log.breadcrumb("Connection failed", crumb);
/* /*
com.sun.mail.util.MailConnectException: Couldn't connect to host, port: 74.125.140.108, 993; timeout 20000; com.sun.mail.util.MailConnectException: Couldn't connect to host, port: 74.125.140.108, 993; timeout 20000;
nested exception is: nested exception is:

Loading…
Cancel
Save