Daryl Walleck | 1465d61 | 2011-11-02 02:22:15 -0500 | [diff] [blame] | 1 | class TimeoutException(Exception): |
Daryl Walleck | e5b83d4 | 2011-11-10 14:39:02 -0600 | [diff] [blame] | 2 | """Exception on timeout""" |
Daryl Walleck | 1465d61 | 2011-11-02 02:22:15 -0500 | [diff] [blame] | 3 | def __repr__(self): |
| 4 | return "Request timed out" |
| 5 | |
| 6 | |
| 7 | class BuildErrorException(Exception): |
Daryl Walleck | e5b83d4 | 2011-11-10 14:39:02 -0600 | [diff] [blame] | 8 | """Exception on server build""" |
Daryl Walleck | 1465d61 | 2011-11-02 02:22:15 -0500 | [diff] [blame] | 9 | def __repr__(self): |
| 10 | return "Server failed into error status" |
Daryl Walleck | adea1fa | 2011-11-15 18:36:39 -0600 | [diff] [blame] | 11 | |
| 12 | |
| 13 | class BadRequest(Exception): |
| 14 | def __init__(self, message): |
| 15 | self.message = message |
| 16 | |
| 17 | def __str__(self): |
| 18 | return repr(self.message) |
Brian Lamar | 12d9b29 | 2011-12-08 12:41:21 -0500 | [diff] [blame^] | 19 | |
| 20 | |
Jay Pipes | 7f75763 | 2011-12-02 15:53:32 -0500 | [diff] [blame] | 21 | class AuthenticationFailure(Exception): |
| 22 | msg = ("Authentication with user %(user)s and password " |
| 23 | "%(password)s failed.") |
Brian Lamar | 12d9b29 | 2011-12-08 12:41:21 -0500 | [diff] [blame^] | 24 | |
Jay Pipes | 7f75763 | 2011-12-02 15:53:32 -0500 | [diff] [blame] | 25 | def __init__(self, **kwargs): |
| 26 | self.message = self.msg % kwargs |
Daryl Walleck | ed8bef3 | 2011-12-05 23:02:08 -0600 | [diff] [blame] | 27 | |
| 28 | |
| 29 | class OverLimit(Exception): |
| 30 | def __init__(self, message): |
| 31 | self.message = message |
| 32 | |
| 33 | def __str__(self): |
| 34 | return repr(self.message) |