OLD | NEW |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 | 2 |
3 """ | 3 """ |
4 requests.exceptions | 4 requests.exceptions |
5 ~~~~~~~~~~~~~~~~~~~ | 5 ~~~~~~~~~~~~~~~~~~~ |
6 | 6 |
7 This module contains the set of Requests' exceptions. | 7 This module contains the set of Requests' exceptions. |
8 | 8 |
9 """ | 9 """ |
10 | 10 |
11 | 11 |
12 class RequestException(RuntimeError): | 12 class RequestException(IOError): |
13 """There was an ambiguous exception that occurred while handling your | 13 """There was an ambiguous exception that occurred while handling your |
14 request.""" | 14 request.""" |
15 | 15 |
16 | 16 |
17 class HTTPError(RequestException): | 17 class HTTPError(RequestException): |
18 """An HTTP error occurred.""" | 18 """An HTTP error occurred.""" |
19 | 19 |
20 def __init__(self, *args, **kwargs): | 20 def __init__(self, *args, **kwargs): |
21 """ Initializes HTTPError with optional `response` object. """ | 21 """ Initializes HTTPError with optional `response` object. """ |
22 self.response = kwargs.pop('response', None) | 22 self.response = kwargs.pop('response', None) |
(...skipping 23 matching lines...) Expand all Loading... |
46 class MissingSchema(RequestException, ValueError): | 46 class MissingSchema(RequestException, ValueError): |
47 """The URL schema (e.g. http or https) is missing.""" | 47 """The URL schema (e.g. http or https) is missing.""" |
48 | 48 |
49 | 49 |
50 class InvalidSchema(RequestException, ValueError): | 50 class InvalidSchema(RequestException, ValueError): |
51 """See defaults.py for valid schemas.""" | 51 """See defaults.py for valid schemas.""" |
52 | 52 |
53 | 53 |
54 class InvalidURL(RequestException, ValueError): | 54 class InvalidURL(RequestException, ValueError): |
55 """ The URL provided was somehow invalid. """ | 55 """ The URL provided was somehow invalid. """ |
| 56 |
| 57 |
| 58 class ChunkedEncodingError(RequestException): |
| 59 """The server declared chunked encoding but sent an invalid chunk.""" |
OLD | NEW |