Exception class for errors commuicating with a http service.
| 51 | |
| 52 | |
| 53 | class HttpError(Exception): |
| 54 | """Exception class for errors commuicating with a http service.""" |
| 55 | |
| 56 | def __init__(self, http_status, message, *args, **kwargs): |
| 57 | super(HttpError, self).__init__(*args, **kwargs) |
| 58 | self.http_status = http_status |
| 59 | self.message = '(%d) %s' % (self.http_status, message) |
| 60 | |
| 61 | def __str__(self): |
| 62 | return self.message |
| 63 | |
| 64 | |
| 65 | def HttpQuery(uri, *, timeout=300, **params): |
no outgoing calls
no test coverage detected
searching dependent graphs…