Krinkle added a comment. |
In T110022#4479395, @Tgr wrote:In T110022#4478166, @Krinkle wrote: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).
In T110022#4483081, @BPirkle wrote: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:
- http-invalid-url ($1: url) – Based on a validation check before the request is made.
- http-bad-status ($1: statusCode, $2: statusText) – After a successful response, read from a public interface.
- 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.
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