summaryrefslogtreecommitdiff
blob: 3fe615ab87569b85dff6a2311722dfd5caba784e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
declare( strict_types = 1 );

namespace MediaWiki\Extension\Translate\PageTranslation;

use RuntimeException;

/**
 * Represents any kind of failure to parse a translatable page source code.
 *
 * This is an internal exception that includes information to produce translated error messages, but
 * actually displaying them to users is handlded by TPException and MediaWiki core.
 *
 * @author Niklas Laxström
 * @license GPL-2.0-or-later
 * @since 2020.08
 */
class ParsingFailure extends RuntimeException {
	private $messageSpec;

	public function __construct( string $message, array $messageSpec ) {
		parent::__construct( $message );
		$this->messageSpec = $messageSpec;
	}

	public function getMessageSpecification(): array {
		return $this->messageSpec;
	}
}