@ Override public void exceptionCaught ( IoSession session , Throwable cause ) throws Exception { ExceptionHandler < Throwable > handler = findExceptionHandler ( cause . getClass ( ) ) ; if ( handler != null ) { handler . exceptionCaught ( session , cause ) ; } else { throw new UnknownMessageTypeException ( "No handler found for exception type: " + cause . getClass ( ) . getSimpleName ( ) ) ; } }
Invoked when any exception is thrown by user IoHandler implementation or by MINA . If cause is an instance of IOException MINA will close the connection automatically .