Last modified: 2014-06-23 21:30:51 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 T69000, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 67000 - Flow: failed API call doesn't provide exception message
Flow: failed API call doesn't provide exception message
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
Flow (Other open bugs)
master
All All
: Unprioritized minor (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-23 21:28 UTC by spage
Modified: 2014-06-23 21:30 UTC (History)
6 users (show)

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


Attachments

Description spage 2014-06-23 21:28:55 UTC
Flow exceptions report a a specific "message from exception, used for debugging error" as well as a generic error code that is localized and shown to the user.  It seems exceptions in API calls don't return the former, making them harder to debug.

To reproduce: 

Stop the parsoid service and issue an action=flow-parsoid-utils request such as:

http://localhost/w/api.php?action=flow-parsoid-utils&format=json&from=wikitext&to=html&content=Hello&title=Main_Page

The API response is
  {"error":{
    "code":"flow-error-process-wikitext",
    "info":"An error has occurred while processing HTML/wikitext conversion."
  }}
but this error code is returned for a number of problems:

  throw new WikitextException( 'Unknown source format: ' . $from, 'process-wikitext' );
  throw new WikitextException( 'Failed contacting Parsoid', 'process-wikitext' );
  throw new WikitextException( "Unknown format requested: " . $to, 'process-wikitext' );
  throw new WikitextException( 'Parser only supports wikitext to HTML conversion', 'process-wikitext' );


It would be nice if the API response included the exception $message (instead of/as well as the English translation of the error code). It doesn't need to be localized and shouldn't be presented to the user.

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


Navigation
Links