Source:
<code>void handleResponse(ResponseInfo responseInfo) { int correlationId = ((PutRequest) responseInfo.getRequest()).getCorrelationId(); ChunkPutRequest request = correlationIdToChunkPutRequest.remove(correlationId); if (request == null) { return; } boolean isSuccessful; if (responseInfo.getError() != null) { setChunkException(new RouterException("Operation timed out", RouterErrorCode.OperationTimedOut)); putManager.responseHandler <START> .onRequestResponseException(request.replicaId, new IOException("NetworkClient error")); <END> isSuccessful = false; } else { try { PutResponse putResponse = PutResponse.readFrom(new DataInputStream(new ByteBufferInputStream(responseInfo.getResponse()))); if (putResponse.getCorrelationId() != correlationId) { logger.error("The correlation id in the PutResponse " + putResponse.getCorrelationId() + " is not the same as the correlation id in the associated PutRequest: " + correlationId); setChunkException(new RouterException("Operation timed out", RouterErrorCode.UnexpectedInternalError)); isSuccessful = false; } else { putManager.responseHandler.onRequestResponseError(request.replicaId, putResponse.getError()); switch (putResponse.getError()) { case No_Error: logger.trace("The putRequest was successful"); isSuccessful = true; break; default: processServerError(putResponse.getError()); isSuccessful = false; logger.trace("Server returned an error: ", putResponse.getError()); break; } } } catch (IOException e) { isSuccessful = false; } } operationTracker.onResponse(request.replicaId, isSuccessful); completeIfDone(); }</code><technical_language>is time add a more exceptions (with error codes) onRequestResponseException() ? This awkward - putting in IOException for sake of it</technical_language>

Target:
void handleResponse(ResponseInfo responseInfo) { int correlationId = ((PutRequest) responseInfo.getRequest()).getCorrelationId(); ChunkPutRequestInfo chunkPutRequestInfo = correlationIdToChunkPutRequestInfo.remove(correlationId); if (chunkPutRequestInfo == null) { return; } boolean isSuccessful; if (responseInfo.getError() != null) { setChunkException(new RouterException("Operation timed out", RouterErrorCode.OperationTimedOut)); responseHandler .onRequestResponseException(chunkPutRequestInfo.replicaId, new IOException("NetworkClient error")); isSuccessful = false; } else { try { PutResponse putResponse = PutResponse.readFrom(new DataInputStream(new ByteBufferInputStream(responseInfo.getResponse()))); if (putResponse.getCorrelationId() != correlationId) { logger.error("The correlation id in the PutResponse " + putResponse.getCorrelationId() + " is not the same as the correlation id in the associated PutRequest: " + correlationId); setChunkException( new RouterException("Unexpected internal error", RouterErrorCode.UnexpectedInternalError)); isSuccessful = false; } else { ServerErrorCode putError = putResponse.getError(); responseHandler.onRequestResponseError(chunkPutRequestInfo.replicaId, putError); if (putError == ServerErrorCode.No_Error) { logger.trace("The putRequest was successful"); isSuccessful = true; } else { processServerError(putResponse.getError()); isSuccessful = false; logger.trace("Server returned an error: ", putResponse.getError()); } } } catch (IOException e) { setChunkException(new RouterException("Response deserialization received an unexpected error", e, RouterErrorCode.UnexpectedInternalError)); isSuccessful = false; } } operationTracker.onResponse(chunkPutRequestInfo.replicaId, isSuccessful); checkAndMaybeComplete(); }