Merge "Make DBAccessBase use DBConnRef, rename $wiki, and hide getLoadBalancer()"
[lhc/web/wiklou.git] / includes / Rest / HttpException.php
1 <?php
2
3 namespace MediaWiki\Rest;
4
5 /**
6 * This is the base exception class for non-fatal exceptions thrown from REST
7 * handlers. The exception is not logged, it is merely converted to an
8 * error response.
9 */
10 class HttpException extends \Exception {
11
12 /** @var array|null */
13 private $errorData = null;
14
15 public function __construct( $message, $code = 500, $errorData = null ) {
16 parent::__construct( $message, $code );
17 $this->errorData = $errorData;
18 }
19
20 /**
21 * @return array|null
22 */
23 public function getErrorData() {
24 return $this->errorData;
25 }
26 }