Krinkle added a comment.

We'd basically map the exception class to a localisation message somewhere [..]

[..]
Mapping by class is not really useful. Mapping by message would involve regex parsing messages - possible but a bit icky (also fragile).

I wish we could map by exception class, but it seems challenging to do that in a useful way. [..]

I was suggesting only a simple map, or a catch-all even – not any form of message extraction. Looking at MediaWiki's current Http, MWHttpRequest and MultiHttpClient class, we also don't provide localisation for low-level details about the error, such as the path to a CA bundle. We have those in exception messages only, not localised. The only user-facing messages we have are:

  1. http-invalid-url ($1: url) – Based on a validation check before the request is made.
  2. http-bad-status ($1: statusCode, $2: statusText) – After a successful response, read from a public interface.
  3. http-internal-error (no params) – Everything else.

This is feasible with either of the two library options (Guzzle and Requests), and likely other libraries as well.


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

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

To: Krinkle
Cc: Imarlier, BPirkle, Nikerabbit, Dereckson, Ladsgroup, Krinkle, PokestarFan, Tgr, Lydia_Pintscher, Ricordisamoa, Legoktm, Addshore, Aklapper, Arch2all, Lahi, Gq86, dmaza, GoranSMilovanovic, DFelten, QZanden, LawExplorer, HakanIST, Abbe98, Hannolans, Samwilson, Wikidata-bugs, aude, Dinoguy1000, fbstj, Tpt, Mbch331, bd808
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to