private void exceptionCaught ( Exception e ) { PeerAddress addr = getAddress ( ) ; String s = addr == null ? "?" : addr . toString ( ) ; if ( e instanceof ConnectException || e instanceof IOException ) { // Short message for network errors log . info ( s + " - " + e . getMessage ( ) ) ; } else { log . warn ( s + " - " , e ) ; Thread . UncaughtExceptionHandler handler = Threading . uncaughtExceptionHandler ; if ( handler != null ) handler . uncaughtException ( Thread . currentThread ( ) , e ) ; } close ( ) ; }
Catch any exceptions logging them and then closing the channel .