Add ILocalizedException interface
authorBrad Jorsch <bjorsch@wikimedia.org>
Thu, 8 Dec 2016 18:38:45 +0000 (13:38 -0500)
committerBrad Jorsch <bjorsch@wikimedia.org>
Thu, 8 Dec 2016 18:53:24 +0000 (13:53 -0500)
commita90bbf1a484c9d22cb04770e92ce18fe3e4bf398
tree0c554de7c11891a7b83d86cb549bc4d136d15fe9
parent20f0da437eeed7e8ca28be911f53535be82889a1
Add ILocalizedException interface

We already throw around some exceptions that are localized
(ErrorPageError and its subclasses, MalformedTitleException), but
there's no standard way to recognize them. Let's change that.

Then let's use them in the API to be able to have internationalized
errors when such exceptions are caught, instead of wrapping the
English-language version.

Change-Id: Iac7c90f92a889f8de9dae373547c07b884addaea
19 files changed:
RELEASE-NOTES-1.29
autoload.php
includes/api/ApiBase.php
includes/api/ApiEditPage.php
includes/api/ApiErrorFormatter.php
includes/api/ApiImport.php
includes/api/ApiMain.php
includes/api/ApiPageSet.php
includes/api/ApiParse.php
includes/api/ApiQueryStashImageInfo.php
includes/api/ApiUpload.php
includes/api/ApiUsageException.php
includes/api/i18n/en.json
includes/api/i18n/qqq.json
includes/exception/ErrorPageError.php
includes/exception/LocalizedException.php [new file with mode: 0644]
includes/exception/PermissionsError.php
includes/libs/rdbms/exception/DBExpectedError.php
includes/title/MalformedTitleException.php