} else if (exception instanceof ConnectionClosingException) { return (ConnectionClosingException) new ConnectionClosingException( "Call to " + addr + " failed on local exception: " + exception).initCause(exception); } else if (exception instanceof ServerTooBusyException) {
} else if (exception instanceof ConnectionClosingException) { return (ConnectionClosingException) new ConnectionClosingException( "Call to " + addr + " failed on local exception: " + exception).initCause(exception); } else if (exception instanceof ServerTooBusyException) {
/** * Takes an Exception and the address we were trying to connect to and return an IOException with * the input exception as the cause. The new exception provides the stack trace of the place where * the exception is thrown and some extra diagnostics information. If the exception is * ConnectException or SocketTimeoutException, return a new one of the same type; Otherwise return * an IOException. * @param addr target address * @param exception the relevant exception * @return an exception to throw */ protected IOException wrapException(InetSocketAddress addr, Exception exception) { if (exception instanceof ConnectException) { // connection refused; include the host:port in the error return (ConnectException) new ConnectException("Call to " + addr + " failed on connection exception: " + exception).initCause(exception); } else if (exception instanceof SocketTimeoutException) { return (SocketTimeoutException) new SocketTimeoutException("Call to " + addr + " failed because " + exception).initCause(exception); } else if (exception instanceof ConnectionClosingException) { return (ConnectionClosingException) new ConnectionClosingException("Call to " + addr + " failed on local exception: " + exception).initCause(exception); } else { return (IOException) new IOException("Call to " + addr + " failed on local exception: " + exception).initCause(exception); } }
} else if (exception instanceof ConnectionClosingException) { return (ConnectionClosingException) new ConnectionClosingException( "Call to " + addr + " failed on local exception: " + exception).initCause(exception); } else if (exception instanceof ServerTooBusyException) {