3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-11 17:55:53 +00:00

Quieter logging in ConnectionHandler

This commit is contained in:
Mike Hearn 2014-12-18 14:17:04 +01:00
parent 4a4691596b
commit 92e28bb516

View File

@ -151,12 +151,12 @@ class ConnectionHandler implements MessageWriteTarget {
setWriteOps();
} catch (IOException e) {
lock.unlock();
log.error("Error writing message to connection, closing connection", e);
log.warn("Error writing message to connection, closing connection", e);
closeConnection();
throw e;
} catch (CancelledKeyException e) {
lock.unlock();
log.error("Error writing message to connection, closing connection", e);
log.warn("Error writing message to connection, closing connection", e);
closeConnection();
throw new IOException(e);
}
@ -226,7 +226,7 @@ class ConnectionHandler implements MessageWriteTarget {
// This can happen eg if the channel closes while the thread is about to get killed
// (ClosedByInterruptException), or if handler.parser.receiveBytes throws something
Throwable t = Throwables.getRootCause(e);
log.error("Error handling SelectionKey: {}", t.getMessage() != null ? t.getMessage() : t.getClass().getName());
log.warn("Error handling SelectionKey: {}", t.getMessage() != null ? t.getMessage() : t.getClass().getName());
handler.closeConnection();
}
}