wiki.techinc.nl/includes/Rest/LocalizedHttpException.php
Petr Pchelko 87a8bd8590 Correctly annotate types for Rest exceptions.
Change-Id: I7ac5d10dbd49777dba2605b27777376253d73938
2020-07-09 07:14:10 -07:00

30 lines
615 B
PHP

<?php
namespace MediaWiki\Rest;
use Wikimedia\Message\MessageValue;
/**
* @newable
*/
class LocalizedHttpException extends HttpException {
private $messageValue;
/**
* @stable for calling
*
* @param MessageValue $messageValue
* @param int $code
* @param array|null $errorData
*/
public function __construct( MessageValue $messageValue, $code = 500, $errorData = null ) {
parent::__construct(
'Localized exception with key ' . $messageValue->getKey(), $code, $errorData
);
$this->messageValue = $messageValue;
}
public function getMessageValue() {
return $this->messageValue;
}
}