Package pushnotify :: Module exceptions
[hide private]
[frames] | no frames]

Source Code for Module pushnotify.exceptions

  1  #!/usr/bin/env python 
  2  # vim: set fileencoding=utf-8 
  3   
  4  """Module for exceptions. 
  5   
  6  copyright: Copyright (c) Jeffrey Goettsch and other contributors. 
  7  license: BSD, see LICENSE for details. 
  8   
  9  """ 
 10   
 11   
12 -class PushNotifyError(Exception):
13 """Base exception for all pushnotify errors. 14 15 Args: 16 args[0]: A string containing a message. 17 args[1]: An integer containing an error. 18 19 """ 20
21 - def __init__(self, *args):
22 23 super(PushNotifyError, self).__init__() 24 self.args = [arg for arg in args]
25 26
27 -class ApiKeyError(PushNotifyError):
28 """Raised when a provided API key is invalid 29 30 Args: 31 args[0]: A string containing a message from the server. 32 args[1]: An integer containing an error code from the server. 33 34 """ 35 36 pass
37 38
39 -class FormatError(PushNotifyError):
40 """Raised when a request is not in the expected format. 41 42 Args: 43 args[0]: A string containing a message from the server. 44 args[1]: An integer containing an error code from the server. 45 46 """ 47 48 pass
49 50
51 -class PermissionDenied(PushNotifyError):
52 """Raised when a request had not been approved. 53 54 Args: 55 args[0]: A string containing a message from the server. 56 args[1]: An integer containing an error code from the server. 57 58 """ 59 60 pass
61 62
63 -class ProviderKeyError(PushNotifyError):
64 """Raised when a provided Provider key is invalid. 65 66 Args: 67 args[0]: A string containing a message from the server. 68 args[1]: An integer containing an error code from the server. 69 70 """ 71 pass
72 73
74 -class RateLimitExceeded(PushNotifyError):
75 """Raised when too many requests are submitted in too small a time 76 frame. 77 78 Args: 79 args[0]: A string containing a message from the server. 80 args[1]: An integer containing an error code from the server. 81 82 """ 83 84 pass
85 86
87 -class ServerError(PushNotifyError):
88 """Raised when the notification server experiences an internal error. 89 90 Args: 91 args[0]: A string containing a message from the server. 92 args[1]: An integer containing an error code from the server. 93 94 """ 95 96 pass
97 98
99 -class UnknownError(PushNotifyError):
100 """Raised when the notification server returns an unknown error. 101 102 Args: 103 args[0]: A string containing a message from the server. 104 args[1]: An integer containing an error code from the server. 105 106 """ 107 108 pass
109 110
111 -class UnrecognizedResponseError(PushNotifyError):
112 """Raised when the notification server returns an unrecognized 113 response. 114 115 Args: 116 args[0]: A string containing the response from the server. 117 args[1]: -1. 118 119 """ 120 121 pass
122 123 124 if __name__ == '__main__': 125 pass 126