errorMessage = $errorMessage; $this->titleText = $titleText; if ( $titleText !== null ) { $errorMessageParameters[] = $titleText; } $this->errorMessageParameters = $errorMessageParameters; // Supply something useful for Exception::getMessage() to return. $enMsg = wfMessage( $errorMessage, $errorMessageParameters ); $enMsg->inLanguage( 'en' )->useDatabase( false ); parent::__construct( $enMsg->text() ); } /** * @since 1.26 * @return string|null */ public function getTitleText() { return $this->titleText; } /** * @since 1.26 * @return string */ public function getErrorMessage() { return $this->errorMessage; } /** * @since 1.26 * @return string[] */ public function getErrorMessageParameters() { return $this->errorMessageParameters; } /** * @since 1.29 * @return Message */ public function getMessageObject() { return wfMessage( $this->getErrorMessage(), $this->getErrorMessageParameters() ); } }