jenkins-bot has submitted this change and it was merged.
Change subject: Additional failure handling with more precise warning ......................................................................
Additional failure handling with more precise warning
- we can check for 'code' and 'info' in the result['edit'] and print these two error hints instead of "unknown failure reason" and its bigger 'warning' content. This is useful e.g. for abusefilter warnings.
Change-Id: Iccb16b967531e5e8afbee97ef378c1a89bded3d3 --- M pywikibot/site.py 1 file changed, 6 insertions(+), 0 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved Mpaa: Looks good to me, but someone else must approve jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py index 4a139fa..409426b 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -3860,6 +3860,12 @@ return False elif 'spamblacklist' in result['edit']: raise SpamfilterError(page, result['edit']['spamblacklist']) + elif 'code' in result['edit'] and 'info' in result['edit']: + self.unlock_page(page) + pywikibot.error( + u"editpage: %s\n%s, " + % (result['edit']['code'], result['edit']['info'])) + return False else: self.unlock_page(page) pywikibot.error(u"editpage: unknown failure reason %s"