Anomie added a comment.

Note I'm not following exactly the design laid out in the current description of this task, for example error codes aren't going away and the message key+params aren't returned in conjunction with text/html output of the message.

Drive-by comments: defaulting to html for error messages might not be a good idea. On the other hand, the mix if html and non-html is not good either. Should we do both by stripping html into plaintext?

The default is the backwards-compatible "plaintext" output, which I'm currently implementing as ->text() (so {{PLURAL}} works) followed by a pass to replace <var>, <kbd>, <samp>, and <code> with quotation marks, remove other HTML tags (with no attempt at semantic awareness of block tags or the like), and unescape HTML entities to give something resembling plaintext.

If the client wants non-BC output, it's responsible for explicitly asking for "plaintext" (as above), "wikitext" (->text()), "html" (->parse()), "raw" (->getKey() and ->getParams()), or "none".

If at some point in the future we decide to not have BC format be the default, we can decide then which format should be.

We should also consider making it more explicit what kind of errors the API can return so that clients can be prepared.

That's almost impossible to do since non-API hooks can easily wind up exposing new errors to the API, which is why the existing attempt along those lines was removed in rMWf0a6435f3b72: API: Remove action="" 'props' and 'errors' result properties.

I am also wondering how to strike the balance of forcing clients to use proper errors related to the user's task instead of generic "failed to save the page".

Would it be possible to loop-in frontend standard groups to think of some standard ways of displaying errors and warnings instead of every system having to do it from scratch?

This task makes it possible for the client to fetch localized text for error messages, but whether or how any client actually uses them is outside the scope of this task.


TASK DETAIL
https://phabricator.wikimedia.org/T47843

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Anomie
Cc: Nikerabbit, Tgr, bearND, MZMcBride, Fhocutt, Aklapper, Ricordisamoa, Wikidata-bugs, Anomie, He7d3r, Catrope, Yurik, wikibugs-l-list, Reedy, daniel, PleaseStand, Sethakill, dg711, jayvdb, Legoktm
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to