Commits

Dustin Shields-Cloues committed c6c3c96

Add detailed error message when search services are under maintenance

Comments (0)

Files changed (2)

     pass
 class UnknownTemplateError(Error):
     pass
+class ServiceUnavailableError(Error):
+    pass
 class InvalidTagNameError(Error):
     pass
 class InvalidRejectError(Error):
     'ValidationError': ValidationError,
     'Invalid_Key': InvalidKeyError,
     'Unknown_Template': UnknownTemplateError,
+    'ServiceUnavailable': ServiceUnavailableError,
     'Invalid_Tag_Name': InvalidTagNameError,
     'Invalid_Reject': InvalidRejectError,
     'Unknown_Sender': UnknownSenderError,
         params = json.dumps(params)
         self.log('POST to %s%s.json: %s' % (ROOT, url, params))
         start = time.time()
-        r = self.session.post('%s%s.json' % (ROOT, url), data=params, headers={'content-type': 'application/json', 'user-agent': 'Mandrill-Python/1.0.34'})
+        r = self.session.post('%s%s.json' % (ROOT, url), data=params, headers={'content-type': 'application/json', 'user-agent': 'Mandrill-Python/1.0.35'})
         try:
             remote_addr = r.raw._original_response.fp._sock.getpeername() # grab the remote_addr before grabbing the text since the socket will go away
         except:
 
         Raises:
            InvalidKeyError: The provided API key is not a valid Mandrill API key
+           ServiceUnavailableError: 
            Error: A general Mandrill error has occurred
         """
         _params = {'query': query, 'date_from': date_from, 'date_to': date_to, 'tags': tags, 'senders': senders, 'limit': limit}
 
 setup(
     name = 'mandrill',
-    version = '1.0.34',
+    version = '1.0.35',
     author = 'Mandrill Devs',
     author_email = 'community@mandrill.com',
     description = 'A CLI client and Python API library for the Mandrill email as a service platform.',