Skip to content

Commit d6bd09b

Browse files
committed
Log IOExceptions using DEBUG level
1 parent a7d3a2d commit d6bd09b

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/main/java/com/beowulfe/hap/impl/http/impl/AccessoryHandler.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,7 @@ public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
8787
@Override
8888
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause)
8989
throws Exception {
90-
boolean errorLevel = true;
91-
if (cause instanceof IOException) {
92-
// Decide level of logging based on exception
93-
errorLevel = !"Connection timed out".equals(cause.getMessage());
94-
}
90+
boolean errorLevel = !(cause instanceof IOException);
9591
if (errorLevel) {
9692
LOGGER.error("Exception caught in web handler", cause);
9793
} else {

src/main/java/com/beowulfe/hap/impl/http/impl/BinaryHandler.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,7 @@ protected void decode(ChannelHandlerContext ctx, ByteBuf in,
5252
@Override
5353
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause)
5454
throws Exception {
55-
boolean errorLevel = true;
56-
if (cause instanceof IOException) {
57-
// Decide level of logging based on exception
58-
errorLevel = !"Connection timed out".equals(cause.getMessage());
59-
}
55+
boolean errorLevel = !(cause instanceof IOException);
6056
if (errorLevel) {
6157
logger.error("Exception in binary handler", cause);
6258
} else {

0 commit comments

Comments
 (0)