http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9149
Revision: 9149
Author: russblau
Date: 2011-04-08 13:18:34 +0000 (Fri, 08 Apr 2011)
Log Message:
-----------
Retry instead of raising HTTP 504 error.
Modified Paths:
--------------
branches/rewrite/pywikibot/data/api.py
Modified: branches/rewrite/pywikibot/data/api.py
===================================================================
--- branches/rewrite/pywikibot/data/api.py 2011-04-08 04:06:26 UTC (rev 9148)
+++ branches/rewrite/pywikibot/data/api.py 2011-04-08 13:18:34 UTC (rev 9149)
@@ -270,8 +270,9 @@
'application/x-www-form-urlencoded'},
body=paramstring)
except Server504Error:
- pywikibot.debug(u"Caught 504 error", _logger)
- raise
+ pywikibot.log(u"Caught HTTP 504 error; retrying")
+ self.wait()
+ continue
#TODO: what other exceptions can occur here?
except Exception, e:
# for any other error on the http request, wait and retry