https://bugzilla.wikimedia.org/show_bug.cgi?id=67000
Bug ID: 67000
Summary: Flow: failed API call doesn't provide exception
message
Product: MediaWiki extensions
Version: master
Hardware: All
OS: All
Status: NEW
Severity: minor
Priority: Unprioritized
Component: Flow
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected],
[email protected], [email protected]
Web browser: ---
Mobile Platform: ---
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.
--
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l