1
2
3
4
5
6 """
7 exception classes.
8 """
9
11 """ default error class """
12 - def __init__(self, msg=None, http_code=None, response=None):
13 self.msg = msg or ''
14 self.status_int = http_code
15 self.response = response
16 Exception.__init__(self)
17
22 message = property(_get_message, _set_message)
23
25 if self.msg:
26 return self.msg
27 try:
28 return str(self.__dict__)
29 except (NameError, ValueError, KeyError), e:
30 return 'Unprintable exception %s: %s' \
31 % (self.__class__.__name__, str(e))
32
33
35 """Exception raised when no resource was found at the given url.
36 """
37
39 """Exception raised when an authorization is required to access to
40 the resource specified.
41 """
42
44 """Exception raised when an unexpected HTTP error is received in response
45 to a request.
46
47
48 The request failed, meaning the remote HTTP server returned a code
49 other than success, unauthorized, or NotFound.
50
51 The exception message attempts to extract the error
52
53 You can get the status code by e.http_code, or see anything about the
54 response via e.response. For example, the entire result body (which is
55 probably an HTML error page) is e.response.body.
56 """
57
59 """Exception raised when the redirection limit is reached."""
60
62 """Exception raised when a request is malformed"""
63
65 """
66 Not a valid url for use with this software.
67 """
68
70 """ Error raised while getting response or decompressing response stream"""
71
72
74 """ raised when proxy error happend"""
75
77 """ Exception returned by the parser when the status line is invalid"""
78 pass
79
81 """ Generic exception returned by the parser """
82 pass
83