public static void addResponseWriteFailureListener ( HttpResponseFuture outboundRespStatusFuture , ChannelFuture channelFuture ) { channelFuture . addListener ( writeOperationPromise -> { Throwable throwable = writeOperationPromise . cause ( ) ; if ( throwable != null ) { if ( throwable instanceof ClosedChannelException ) { throwable = new IOException ( REMOTE_CLIENT_CLOSED_WHILE_WRITING_OUTBOUND_RESPONSE_HEADERS ) ; } outboundRespStatusFuture . notifyHttpListener ( throwable ) ; } } ) ; }
Adds a listener to notify the outbound response future if an error occurs while writing the response message .