Dealing with Exceptions is part of any program,bur software that makes use of external services
(such as HTTP services) must pay additional attention to exceptions because the potential for
errors is magnified.
There are several types of exceptions that you can expect while making use of HTTP services.
- Transport Exceptions
- Protocol Exceptions
- Timeouts.
You should understand when these exceptions could occur.
* Transport Exceptions can occur due to no. of reasons,but the most likely scenario with a mobile
device is poor network connectivity.
* Protocol Exceptions at the HTTP protocol layer.These include authentication errors,invalid cookies, and so on.
* Timeouts,with respect to HTTP calls,come in two flavors :
- Connection Timeouts.
- Socket Timeouts.
* A Connection Timeout can occur if the HttpClient is not able to connect to the HTTP server.
* A Socket Timeout can occur if the HttpClient fails to recieve a response within a defined time period.
(such as HTTP services) must pay additional attention to exceptions because the potential for
errors is magnified.
There are several types of exceptions that you can expect while making use of HTTP services.
- Transport Exceptions
- Protocol Exceptions
- Timeouts.
You should understand when these exceptions could occur.
* Transport Exceptions can occur due to no. of reasons,but the most likely scenario with a mobile
device is poor network connectivity.
* Protocol Exceptions at the HTTP protocol layer.These include authentication errors,invalid cookies, and so on.
* Timeouts,with respect to HTTP calls,come in two flavors :
- Connection Timeouts.
- Socket Timeouts.
* A Connection Timeout can occur if the HttpClient is not able to connect to the HTTP server.
* A Socket Timeout can occur if the HttpClient fails to recieve a response within a defined time period.