jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/326313 )
Change subject: site_detect.py: Raise ServerError on 500 response ......................................................................
site_detect.py: Raise ServerError on 500 response
A test for wikichristian.org is occasionally returning 500 error codes and making travis builds fail. Raising a ServerError here will make that test skip.
Bug: T151368 Change-Id: I9e0c5d64c28f8d4baf860541ad518c4ae861177d --- M pywikibot/site_detect.py 1 file changed, 2 insertions(+), 0 deletions(-)
Approvals: Magul: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site_detect.py b/pywikibot/site_detect.py index cc69e4b..4eb78d7 100644 --- a/pywikibot/site_detect.py +++ b/pywikibot/site_detect.py @@ -54,6 +54,8 @@ r = fetch(fromurl) if r.status == 503: raise ServerError('Service Unavailable') + elif r.status == 500: + raise ServerError('Internal Server Error')
if fromurl != r.data.url: pywikibot.log('{0} redirected to {1}'.format(fromurl, r.data.url))