Xqt has submitted this change and it was merged.
Change subject: Add debugging aids for networking
......................................................................
Add debugging aids for networking
Change-Id: Iff6fccb9d12628a8fd6efff3fd2a822f324b112a
---
M pywikibot/comms/http.py
M wikipedia.py
2 files changed, 2 insertions(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index 2f11b4b..3c265f4 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -129,6 +129,7 @@
except KeyboardInterrupt:
raise
except urllib2.HTTPError, e:
+ debug(u'Page %s could not be retrieved: HTTP/%i %s: %r' % (url,
e.code, e.message, e.read()))
if e.code in [401, 404]:
raise PageNotFound(
u'Page %s could not be retrieved. Check your family file.'
diff --git a/wikipedia.py b/wikipedia.py
index 98da805..80fabc5 100644
--- a/wikipedia.py
+++ b/wikipedia.py
@@ -7029,6 +7029,7 @@
raise
except urllib2.HTTPError, e:
if e.code in [401, 404]:
+ debug(u"Got HTTP/%i %s: \n %r" % (e.code, e.message,
e.read()))
raise PageNotFound(u'Page %s could not be retrieved. Check '
u'your family file ?' % url)
# just check for HTTP Status 500 (Internal Server Error)?
--
To view, visit
https://gerrit.wikimedia.org/r/92075
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iff6fccb9d12628a8fd6efff3fd2a822f324b112a
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot