Skip to content

Commit

Permalink
STORM-3374 remove unnecessary stacktrace from log
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Gresch committed Apr 15, 2019
1 parent 1976cb3 commit 0dafa83
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package org.apache.storm.messaging.netty;

import java.io.IOException;
import java.net.ConnectException;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -96,7 +97,11 @@ public void channelRead(ChannelHandlerContext ctx, Object message) throws Except
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
if (!(cause instanceof ConnectException)) {
LOG.info("Connection to " + client.getDstAddress() + " failed:", cause);
if (cause instanceof IOException) {
LOG.info("Connection to {} failed: {}", client.getDstAddress(), cause.getMessage());
} else {
LOG.error("Connection to {} failed: {}", client.getDstAddress(), cause);
}
}
}
}

0 comments on commit 0dafa83

Please sign in to comment.