Last modified: 2014-08-05 19:25:39 UTC
While trying to reproduce bug 68472 I triggered network errors: 1. View a Flow board on local MW server. 2. Open browser 3. On server rename api.php to api_BROKEN.php 4. Click Summrize topic, or click Reply and then click [Reply], etc. Result: nothing is reported to the user despite the api response being 404 Not Found. The console reports a JS error TypeError: result.error is undefined from if ( result.error.prev_revision ) in apiHandlers[ handlerName ] fail(). In this failure case, there's no result.error , hence the JS error. Even if avoided, Flow displays "undefioned" in its pink errorbox because there's nothing in result.error.info; it seems that if there's a network error the failure information is in result.exception ("Not found") and result.textStatus ("error"). (It sucks that different levels of API failure put information in different pieces of the result object.)
https://gerrit.wikimedia.org/r/#/c/148691/ avoids the JS failure, so I lowered the priority * It still assumes if there's a result.error then result.error.info will contain a text string. * It assumes any API failure is an HTTP error. I have a patch that's addresses these.
Change 148870 had a related patch set uploaded by Spage: More robust API error reporting https://gerrit.wikimedia.org/r/148870
Change 148870 merged by jenkins-bot: More robust API error reporting https://gerrit.wikimedia.org/r/148870
I just got a 503 error on beta labs, and it displayed '"flow-error-http' ("An error occurred while contacting the server."), so fixed.