Last modified: 2010-05-15 16:03:48 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 T16758, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 14758 - Invalid JSON produced by API when API error produced
Invalid JSON produced by API when API error produced
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.13.x
All All
: Normal normal (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-08 15:14 UTC by Jools Wills
Modified: 2010-05-15 16:03 UTC (History)
2 users (show)

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


Attachments

Description Jools Wills 2008-07-08 15:14:12 UTC
If the api throws an error and the format is set to JSON, the error is additionally tagged onto the end of the JSON making it fail on JSON parsers.

for example

http://en.wikipedia.org/w/api.php?action=invalid&meta=siteinfo&format=json

will produce

{"error":{"code":"unknown_action","info":"Unrecognized value for parameter 'action': invalid"}}unknown_action: Unrecognized value for parameter 'action': invalid

instead of

{"error":{"code":"unknown_action","info":"Unrecognized value for parameter 'action': invalid"}}
Comment 1 Roan Kattouw 2008-07-08 20:54:27 UTC
Fixed in r37349. The error handler called getAllowedParams() while it was being invoked because getAllowedParams() threw the error in question.

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


Navigation
Links