Need to move from try block to catch
<p>I have written some code in the try block as follows.</p>

<pre><code>try {
    if (server1IPAddress != "") {
    if ( InetAddress.getByName(server1IPAddress).isReachable(1000) == false) {
        }
            InsertUploadedTrancasctionDetails(server1IPAddress, deviceId,
                                              XMLTransactionData);
    }
} catch (Exception exception) {
    if ((server1IPAddress != server2IPAddress)
        &amp;&amp; (server2IPAddress != "")) {
            InsertUploadedTrancasctionDetails(server2IPAddress, deviceId, 
                                              XMLTransactionData);
}
</code></pre>

<p>when we are not able to reach an IP Address i need to move from try block if condtion to catch block ie when IP address reachable is false.</p>

<pre><code>if ( InetAddress.getByName(server1IPAddress).isReachable(1000) == false) {
}
</code></pre>

<p>I am not able to make an exception in the if block.</p>

<p>Is there any way to move from the If block to the catch block without making an exception or by making an exception in the if block.</p>

<p>Will any one help me please.</p>
