Merge "Revert "Introduce AbstractLocalizedException""
This commit is contained in:
commit
79e081810d
7 changed files with 5 additions and 50 deletions
|
|
@ -7,7 +7,6 @@ $wgAutoloadLocalClasses = [
|
|||
'APCUBagOStuff' => __DIR__ . '/includes/libs/objectcache/APCUBagOStuff.php',
|
||||
'AbkhazUppercaseCollation' => __DIR__ . '/includes/collation/AbkhazUppercaseCollation.php',
|
||||
'AbstractContent' => __DIR__ . '/includes/content/AbstractContent.php',
|
||||
'AbstractLocalizedException' => __DIR__ . '/includes/exception/AbstractLocalizedException.php',
|
||||
'Action' => __DIR__ . '/includes/actions/Action.php',
|
||||
'ActiveUsersPager' => __DIR__ . '/includes/specials/pagers/ActiveUsersPager.php',
|
||||
'ActivityUpdateJob' => __DIR__ . '/includes/jobqueue/jobs/ActivityUpdateJob.php',
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
* @newable
|
||||
* @ingroup API
|
||||
*/
|
||||
class ApiUsageException extends AbstractLocalizedException {
|
||||
class ApiUsageException extends MWException implements ILocalizedException {
|
||||
|
||||
protected $modulePath;
|
||||
protected $status;
|
||||
|
|
|
|||
|
|
@ -1,44 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
* http://www.gnu.org/copyleft/gpl.html
|
||||
*
|
||||
* @file
|
||||
*/
|
||||
|
||||
use MediaWiki\Message\Converter;
|
||||
use Wikimedia\Message\MessageValue;
|
||||
|
||||
/**
|
||||
* @since 1.37
|
||||
* @ingroup Exception
|
||||
*/
|
||||
abstract class AbstractLocalizedException extends MWException implements ILocalizedException {
|
||||
|
||||
/**
|
||||
* Return a Message object for this exception
|
||||
* @return Message
|
||||
*/
|
||||
abstract public function getMessageObject();
|
||||
|
||||
/**
|
||||
* Return a MessageValue object for this exception
|
||||
* @return MessageValue
|
||||
*/
|
||||
public function getMessageValue() {
|
||||
$converter = new Converter();
|
||||
return $converter->convertMessage( $this->getMessageObject() );
|
||||
}
|
||||
}
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
* @since 1.7
|
||||
* @ingroup Exception
|
||||
*/
|
||||
class ErrorPageError extends AbstractLocalizedException {
|
||||
class ErrorPageError extends MWException implements ILocalizedException {
|
||||
public const SEND_OUTPUT = 0;
|
||||
public const STAGE_OUTPUT = 1;
|
||||
public $title, $msg, $params;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
* @ingroup Exception
|
||||
* @note Don't use this in a situation where MessageCache is not functional.
|
||||
*/
|
||||
class LocalizedException extends AbstractLocalizedException {
|
||||
class LocalizedException extends Exception implements ILocalizedException {
|
||||
/** @var string|array|MessageSpecifier */
|
||||
protected $messageSpec;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
* @newable
|
||||
* @since 1.23
|
||||
*/
|
||||
class MalformedTitleException extends AbstractLocalizedException {
|
||||
class MalformedTitleException extends Exception implements ILocalizedException {
|
||||
|
||||
/** @var string|null */
|
||||
private $titleText;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
* @newable
|
||||
* @ingroup Upload
|
||||
*/
|
||||
class UploadStashException extends AbstractLocalizedException {
|
||||
class UploadStashException extends MWException implements ILocalizedException {
|
||||
/** @var string|array|MessageSpecifier */
|
||||
protected $messageSpec;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue