Joe Gregorio | 3ad5e9a | 2010-12-09 15:01:04 -0500 | [diff] [blame] | 1 | #!/usr/bin/python2.4 |
| 2 | # |
| 3 | # Copyright 2010 Google Inc. All Rights Reserved. |
| 4 | |
| 5 | """Errors for the library. |
| 6 | |
| 7 | All exceptions defined by the library |
| 8 | should be defined in this file. |
| 9 | """ |
| 10 | |
| 11 | __author__ = 'jcgregorio@google.com (Joe Gregorio)' |
| 12 | |
| 13 | |
| 14 | class Error(Exception): |
| 15 | """Base error for this module.""" |
| 16 | pass |
| 17 | |
| 18 | |
| 19 | class HttpError(Error): |
| 20 | """HTTP data was invalid or unexpected.""" |
| 21 | |
| 22 | def __init__(self, resp, detail): |
| 23 | self.resp = resp |
| 24 | self.detail = detail |
| 25 | |
| 26 | def __str__(self): |
| 27 | return self.detail |
| 28 | |
| 29 | |
| 30 | class UnknownLinkType(Error): |
| 31 | """Link type unknown or unexpected.""" |
| 32 | pass |