According to Not able to add ArcGISDynamicMapServiceLayer in Arc
When you don't properly set the proxy parameters you get HttpHostConnectException. How can you catch this connection exception (org.apache.http.conn.HttpHostConnectException) since it's not thrown by JMap class itself. I need to catch this error and take suitable actions or an appropriate warning message about the proxy parameters correctness.
I tried:
MapOptions mapOptions = new MapOptions(MapType.STREETS, 24.43261, -102.92041, 4);
try{
JMap jMap = new JMap(mapOptions);
jMap.setWrapAroundEnabled(true);
}
catch(HttpHostConnectException e){
// Handle error connection due to incorrect proxy parameters
}
But, of course, the compiler claims "Out of Reach try catch clause"