jenkins-bot submitted this change.

View Change

Approvals: JJMC89: Looks good to me, approved jenkins-bot: Verified
[IMPR] Add requests.Response.headers to log when an API error occurs

Bug: T272325
Change-Id: I8be4475bf10504311c236e1a42e1d6775aacab3a
---
M pywikibot/data/api.py
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 2106b0a..99c1225 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -1853,6 +1853,7 @@
'help': result['error']['help']}}

pywikibot.warning('API error %s: %s' % (code, info))
+ pywikibot.log(' headers=\n{}'.format(response.headers))

if self._internal_api_error(code, error, result):
continue

To view, visit change 657042. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I8be4475bf10504311c236e1a42e1d6775aacab3a
Gerrit-Change-Number: 657042
Gerrit-PatchSet: 5
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: JJMC89 <JJMC89.Wikimedia@gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-CC: Mpaa <mpaa.wiki@gmail.com>
Gerrit-MessageType: merged