level, $xmlerror->code, trim( $xmlerror->message ) ); } libxml_clear_errors(); throw new XmlMarkupParseErrorException( $errors ); } return $xml; } protected static function logXmlParseError( $level, $code, $message ) { WikiaLogger::instance()->info( "PortableInfobox XML Parser problem", [ "level" => $level, "code" => $code, "message" => $message ] ); } } class XmlMarkupParseErrorException extends \Exception { private $errors; public function __construct( $errors ) { $this->errors = $errors; return parent::__construct(); } public function getErrors() { return $this->errors; } }