Permalink
Browse files

Output less stackTraces

  • Loading branch information...
1 parent bae0dc4 commit 786bd66e742bfa7c2fb303a3bc6210e4c46dd5f9 Daniel Gómez Ferro committed May 10, 2013
View
6 src/main/java/com/yahoo/pasc/paxos/server/LeaderElection.java
@@ -35,14 +35,16 @@ public void start() {
zk.create(ELECTION_PATH, null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
} catch (KeeperException.NoNodeException e) {
// ignore
+ } catch (KeeperException.NodeExistsException e) {
+ // ignore
} catch (Exception e) {
- e.printStackTrace();
+ LOG.warn("Unexpected exception: " + e);
}
try {
zk.create(ELECTION_PATH + "/" + id, null, Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL);
// checkLeadership(zk.getChildren(ELECTION_PATH, this));
} catch (Exception e) {
- e.printStackTrace();
+ LOG.warn("Unexpected exception: " + e);
}
}
View
3 src/main/java/com/yahoo/pasc/paxos/server/ServerHandler.java
@@ -163,8 +163,7 @@ public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Ex
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) {
- if (!(e.getCause() instanceof ClosedChannelException))
- e.getCause().printStackTrace();
+ LOG.warn("Unexpected exception: " + e.getCause());
Channel ch = e.getChannel();
ch.close();

0 comments on commit 786bd66

Please sign in to comment.