getErrorMessage(); if ( !$errorMessage ) { parent::__construct( 'badtitle', 'badtitletext', [] ); } else { $errorMessageParams = $msg->getErrorMessageParameters(); parent::__construct( 'badtitle', $errorMessage, $errorMessageParams ); } } else { parent::__construct( 'badtitle', $msg, $params ); } } /** * @inheritDoc */ public function report( $action = self::SEND_OUTPUT ) { global $wgOut; $wgOut->setStatusCode( 404 ); parent::report( self::STAGE_OUTPUT ); // Unconditionally cache the error for an hour, see T316932 $wgOut->enableClientCache(); $wgOut->setCdnMaxage( 3600 ); if ( $action === self::SEND_OUTPUT ) { $wgOut->output(); } } }