After catching the REST exception, just throw an API exception.
Remove the step inbetween where we built a response array.
Bonus:
* Remove tests that only tested this array building.
* Remove the unused 'code' from successful responses, and update
documentation of return value shapes.
* Remove impossible check for `$ex instanceof LocalizedException`.
After moving the code into one place, it's obvious that it can't
happen, since LocalizedException doesn't inherit from HttpException.
Bug: T341613
Change-Id: I31370efeed9d5283b53eafca102b2f1efc811d27
This patch makes the following assumptions:
1. There is no class outside of this codebase that implements the
ParsoidClient interface. According to CodeSearch this appears to be
correct.
2. It is fine to use the Bcp47Code instead of the internal MediaWiki
language code in the "Accept-Language" HTTP header. As far as I
understand this might even qualify as a bugfix.
Depends-On: If059674597e261039df7f4613a89cb08120c3262
Change-Id: Icd160da2d5555891b9a91a0cb966bd36a55f6fdd
This makes the "direct" client and the VRS based client
implement the same interface, so the caller doesn't have to know
which one it is using.
It looks like ParsoidHelper will not be needed if we use this approach.
Change-Id: Ib1c1d7355951fc0765227dd01a9edfc554fc448d