Reputation: 9835
I have the following:
try {
response.statusCode = urlConnection.getResponseCode();
} catch(IOException e) {
throw e;
}
I look at the debugger and e = UnknownHostException
After the throw I have:
try {
NetworkResponse response = NetworkHelper.getByURL(url);
} catch(Exception e) { <------- IT LANDS HERE, BUT e=null
ExceptionHelper.announce(e);
throw e;
}
So after the throw my catch block gets the exception but it's null. The debugger shows e=null.
I have no idea why this would happen.
Upvotes: 18
Views: 734
Reputation: 15766
I don't even see the point of catching the exception if you just immediately rethrow it. Add a throws IOException
to that method and let the other catch
handle it.
Upvotes: 1