Different types of errors and exceptions will be raised when something goes wrong in the process of sending a request and getting back a response. Some of them are as follows:
HTTPError
: When there are invalid HTTP responses, Requests will raise an HTTPError
exceptionConnectionError
: If there is a network problem, such as refused connection and DNS failure, Requests will raise a ConnectionError
exceptionTimeout
: If the request gets timed out, this exception will be raisedTooManyRedirects
: If the request surpasses the configured number of maximum redirections, this type of exception is raisedOther types of exception that come in to the picture are Missing schema Exception
, InvalidURL
, ChunkedEncodingError
, and ContentDecodingError
and so on.
This example has been taken from Request documents available at http://docs.python-requests.org/en/latest/user/quickstart/#errors-and-exceptions.
52.14.240.252