jayvdb added a comment.

I saw a batch of these today on a development branch, and one of the included a 
real error message thanks to https://phabricator.wikimedia.org/T93305:

  ERROR: testQueryApiGetter (tests.wikidataquery_tests.TestApiSlowFunctions)
  Test that we can actually retreive data and that caching works.
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File 
"/home/travis/build/jayvdb/pywikibot-core/tests/wikidataquery_tests.py", line 
252, in testQueryApiGetter
      data = w.query(q)
    File 
"/home/travis/build/jayvdb/pywikibot-core/pywikibot/data/wikidataquery.py", 
line 601, in query
      data = self.getDataFromHost(fullQueryString)
    File 
"/home/travis/build/jayvdb/pywikibot-core/pywikibot/data/wikidataquery.py", 
line 581, in getDataFromHost
      % (url, data))
  ServerError: Data received for 
https://wdq.wmflabs.org/api?q=claim%5B105%5D%20AND%20noclaim%5B225%5D%20AND%20claim%5B100%5D
 but no JSON could be decoded: u'<html>\r\n<head><title>502 Bad 
Gateway</title></head>\r\n<body bgcolor="white">\r\n<center><h1>502 Bad 
Gateway</h1></center>\r\n<hr><center>nginx/1.4.6 
(Ubuntu)</center>\r\n</body>\r\n</html>\r\n'

So, why isnt `http.fetch(url)` raising ServerError much earlier ?  
http.error_handling_callback should probably raise ServerError for any 500 
series code, and 502 could be treated similarly to Server504Error.


TASK DETAIL
  https://phabricator.wikimedia.org/T89769

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: jayvdb
Cc: pywikibot-bugs, jayvdb, Aklapper



_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to