Fix Exception logging Timber lint errors

This commit is contained in:
Philip Whitehouse 2017-03-18 17:47:32 +00:00 committed by Vincent Breitmoser
parent 5e4068de45
commit d9bde84daf
4 changed files with 10 additions and 10 deletions

View file

@ -67,7 +67,7 @@ public class TextBody implements Body, SizeAware {
}
return new ByteArrayInputStream(b);
} catch (UnsupportedEncodingException uee) {
Timber.e(uee, "Unsupported charset: " + charset);
Timber.e(uee, "Unsupported charset: %s", charset);
return null;
}
}

View file

@ -161,7 +161,7 @@ class ImapFolder extends Folder<ImapMessage> {
} catch (IOException ioe) {
throw ioExceptionHandler(connection, ioe);
} catch (MessagingException me) {
Timber.e(me, "Unable to open connection for " + getLogId(), me);
Timber.e(me, "Unable to open connection for %s", getLogId());
throw me;
}
}
@ -901,7 +901,7 @@ class ImapFolder extends Folder<ImapMessage> {
parseBodyStructure(bs, message, "TEXT");
} catch (MessagingException e) {
if (K9MailLib.isDebug()) {
Timber.d(e, "Error handling message for " + getLogId(), e);
Timber.d(e, "Error handling message for %s", getLogId());
}
message.setBody(null);
}
@ -1322,7 +1322,7 @@ class ImapFolder extends Folder<ImapMessage> {
return null;
}
} catch (Exception e) {
Timber.e(e, "Exception while updated push state for " + getLogId());
Timber.e(e, "Exception while updated push state for %s", getLogId());
return null;
}
}
@ -1354,7 +1354,7 @@ class ImapFolder extends Folder<ImapMessage> {
}
private MessagingException ioExceptionHandler(ImapConnection connection, IOException ioe) {
Timber.e(ioe, "IOException for " + getLogId());
Timber.e(ioe, "IOException for %s", getLogId());
if (connection != null) {
connection.close();

View file

@ -413,7 +413,7 @@ class WebDavFolder extends Folder<WebDavMessage> {
wdMessage.parse(istream);
} catch (IOException ioe) {
Timber.e(ioe, "IOException: " + ioe.getMessage());
Timber.e(ioe, "IOException during message parsing");
throw new MessagingException("I/O Error", ioe);
} finally {
IOUtils.closeQuietly(reader);
@ -430,8 +430,8 @@ class WebDavFolder extends Folder<WebDavMessage> {
Timber.e(use, "URISyntaxException caught");
throw new MessagingException("URISyntaxException caught", use);
} catch (IOException ioe) {
Timber.e(ioe, "Non-success response code loading message, response code was " + statusCode
+ "\nURL: " + wdMessage.getUrl());
Timber.e(ioe, "Non-success response code loading message, response code was %d, URL: %s",
statusCode, wdMessage.getUrl());
throw new MessagingException("Failure code " + statusCode, ioe);
}

View file

@ -813,10 +813,10 @@ public class WebDavStore extends RemoteStore {
Scheme s = new Scheme("https", new WebDavSocketFactory(hostname, 443), 443);
reg.register(s);
} catch (NoSuchAlgorithmException nsa) {
Timber.e(nsa, "NoSuchAlgorithmException in getHttpClient: ");
Timber.e(nsa, "NoSuchAlgorithmException in getHttpClient");
throw new MessagingException("NoSuchAlgorithmException in getHttpClient: ", nsa);
} catch (KeyManagementException kme) {
Timber.e(kme, "KeyManagementException in getHttpClient: " + kme);
Timber.e(kme, "KeyManagementException in getHttpClient");
throw new MessagingException("KeyManagementException in getHttpClient: ", kme);
}
}