Last modified: 2014-08-05 19:25:39 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T70474, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 68474 - Flow: 404 API error not reported to user, instead causes JS errors
Flow: 404 API error not reported to user, instead causes JS errors
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Flow (Other open bugs)
master
All All
: Low minor (vote)
: ---
Assigned To: Matthias Mullie
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-23 21:08 UTC by spage
Modified: 2014-08-05 19:25 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description spage 2014-07-23 21:08:17 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.)
Comment 1 spage 2014-07-23 22:37:08 UTC
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.
Comment 2 Gerrit Notification Bot 2014-07-23 22:37:22 UTC
Change 148870 had a related patch set uploaded by Spage:
More robust API error reporting

https://gerrit.wikimedia.org/r/148870
Comment 3 Gerrit Notification Bot 2014-07-24 12:20:10 UTC
Change 148870 merged by jenkins-bot:
More robust API error reporting

https://gerrit.wikimedia.org/r/148870
Comment 4 spage 2014-08-05 19:25:39 UTC
I just got a 503 error on beta labs, and it displayed '"flow-error-http' ("An error occurred while contacting the server."), so fixed.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links