Revision: 4863 Author: btongminh Date: 2008-01-12 22:14:39 +0000 (Sat, 12 Jan 2008)
Log Message: ----------- Catch server errors
Modified Paths: -------------- trunk/pywikipedia/commonsdelinker/image_replacer.py
Modified: trunk/pywikipedia/commonsdelinker/image_replacer.py =================================================================== --- trunk/pywikipedia/commonsdelinker/image_replacer.py 2008-01-12 20:49:54 UTC (rev 4862) +++ trunk/pywikipedia/commonsdelinker/image_replacer.py 2008-01-12 22:14:39 UTC (rev 4863) @@ -256,6 +256,10 @@ except wikipedia.PageNotSaved, e: output(u'Warning! Unable to report replacement to %s.' % old_image, False) output('%s: %s' % (e.__class__.__name__, str(e)), False) + except wikipedia.ServerError, e: + output(u'Warning! Server error while reporting replacement to %s.' % old_image, False) + output('%s: %s' % (e.__class__.__name__, str(e)), False) + return self.report((old_image, new_image, user, comment, not_ok)) else: output(u'Reporting replacement of %s by %s.' % \ (old_image, new_image))
pywikipedia-l@lists.wikimedia.org