Skip to content
Snippets Groups Projects
Commit 09baff19 authored by cariaso's avatar cariaso Committed by Dan Michael O. Heggø
Browse files

Detect, warn and retry on nonce error (#165)

Retry on nonce errors since these can be caused by temporary cache connection errors.
parent 2f7151aa
No related branches found
No related tags found
No related merge requests found
......@@ -307,6 +307,13 @@ class Site(object):
sleeper.sleep()
return False
# cope with https://phabricator.wikimedia.org/T106066
if (info['error'].get('code') == u'mwoauth-invalid-authorization' and
'Nonce already used' in info['error'].get('info')):
log.warning('retrying due to nonce error https://phabricator.wikimedia.org/T106066')
sleeper.sleep()
return False
if 'query' in info['error']:
# Semantic Mediawiki does not follow the standard error format
raise errors.APIError(None, info['error']['query'], kwargs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment