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); return new ByteArrayInputStream(b);
} catch (UnsupportedEncodingException uee) { } catch (UnsupportedEncodingException uee) {
Timber.e(uee, "Unsupported charset: " + charset); Timber.e(uee, "Unsupported charset: %s", charset);
return null; return null;
} }
} }

View file

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

View file

@ -413,7 +413,7 @@ class WebDavFolder extends Folder<WebDavMessage> {
wdMessage.parse(istream); wdMessage.parse(istream);
} catch (IOException ioe) { } catch (IOException ioe) {
Timber.e(ioe, "IOException: " + ioe.getMessage()); Timber.e(ioe, "IOException during message parsing");
throw new MessagingException("I/O Error", ioe); throw new MessagingException("I/O Error", ioe);
} finally { } finally {
IOUtils.closeQuietly(reader); IOUtils.closeQuietly(reader);
@ -430,8 +430,8 @@ class WebDavFolder extends Folder<WebDavMessage> {
Timber.e(use, "URISyntaxException caught"); Timber.e(use, "URISyntaxException caught");
throw new MessagingException("URISyntaxException caught", use); throw new MessagingException("URISyntaxException caught", use);
} catch (IOException ioe) { } catch (IOException ioe) {
Timber.e(ioe, "Non-success response code loading message, response code was " + statusCode Timber.e(ioe, "Non-success response code loading message, response code was %d, URL: %s",
+ "\nURL: " + wdMessage.getUrl()); statusCode, wdMessage.getUrl());
throw new MessagingException("Failure code " + statusCode, ioe); 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); Scheme s = new Scheme("https", new WebDavSocketFactory(hostname, 443), 443);
reg.register(s); reg.register(s);
} catch (NoSuchAlgorithmException nsa) { } catch (NoSuchAlgorithmException nsa) {
Timber.e(nsa, "NoSuchAlgorithmException in getHttpClient: "); Timber.e(nsa, "NoSuchAlgorithmException in getHttpClient");
throw new MessagingException("NoSuchAlgorithmException in getHttpClient: ", nsa); throw new MessagingException("NoSuchAlgorithmException in getHttpClient: ", nsa);
} catch (KeyManagementException kme) { } catch (KeyManagementException kme) {
Timber.e(kme, "KeyManagementException in getHttpClient: " + kme); Timber.e(kme, "KeyManagementException in getHttpClient");
throw new MessagingException("KeyManagementException in getHttpClient: ", kme); throw new MessagingException("KeyManagementException in getHttpClient: ", kme);
} }
} }