Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Commit

Permalink
[MINOR] Render handler exception to System.err instead of .out (#334)
Browse files Browse the repository at this point in the history
* render error message to System.err instead of .out

* log and check exception type

* add else

* simplification of explanitory comment
  • Loading branch information
smatthewenglish authored Nov 30, 2018
1 parent b8dbfd5 commit 7a40843
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import tech.pegasys.pantheon.util.NetworkUtility;
import tech.pegasys.pantheon.util.bytes.BytesValue;

import java.io.IOException;
import java.net.BindException;
import java.net.InetSocketAddress;
import java.net.SocketException;
Expand Down Expand Up @@ -222,12 +223,16 @@ private void initialize(final DatagramSocket socket, final int tcpPort) {
}

/**
* This is the exception handler for uncontrolled exceptions ocurring in the packet handlers.
* For uncontrolled exceptions occurring in the packet handlers.
*
* @param throwable the exception that was raised
* @param exception the exception that was raised
*/
private void handleException(final Throwable throwable) {
System.out.println(throwable);
private void handleException(final Throwable exception) {
if (exception instanceof IOException) {
LOG.debug("Packet handler exception", exception);
} else {
LOG.error("Packet handler exception", exception);
}
}

/**
Expand Down

0 comments on commit 7a40843

Please sign in to comment.