Hi Markus,
for reference, our error message parsing happens in WikibaseJavaScriptApi: https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FWikibaseJavaScriptAp... This is only used for parsing errors returned by Wikibase API modules, though.
On Tue, Sep 1, 2015 at 5:17 PM, Markus Krötzsch markus@semantic-mediawiki.org wrote:
On 01.09.2015 16:57, Thiemo Mättig wrote:
Hi,
I now identified another format for API warnings [...] from action
"watch"
I'm not absolutely sure, but I think this is not really an other format. The "warnings" field contains a list of modules. For each module you can either have a list of "messages", or a plain string. In the later case the string is stored with the "*" key you see in both examples.
The relevant code that creates these "warnings" structures for Wikibase can be found in the ApiErrorReporter class.
The { "name": ..., "parameters": ..., "html": { "*": ... } } thing you see is a rendering of a Message object. The "html" key can be seen in \ApiErrorFormatter::addWarningOrError, the "*" is a result from the Message class.
Hope that helps.
Yes, this is very helpful. Thanks. I had looked at this PHP code, but I could not see these things there (strings like "*" are not very distinctive, so I was not sure which "*" I am looking at ;-).
Markus
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech