From: Alexandre Emsenhuber Date: Sun, 5 Dec 2010 13:57:07 +0000 (+0000) Subject: Converted WikiError to MWException so at least users can see the problem (nothing... X-Git-Tag: 1.31.0-rc.0~33547 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=249022d65e4832ace60c17e17aa97838141a5706;p=lhc%2Fweb%2Fwiklou.git Converted WikiError to MWException so at least users can see the problem (nothing was checking the return value of WikiExporter::dumpFrom() and realted methods) --- diff --git a/includes/Export.php b/includes/Export.php index bdb9d4af1f..22d6a1fe82 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -130,7 +130,7 @@ class WikiExporter { public function pageByName( $name ) { $title = Title::newFromText( $name ); if( is_null( $title ) ) { - return new WikiError( "Can't export invalid title" ); + throw new MWException( "Can't export invalid title" ); } else { return $this->pageByTitle( $title ); } @@ -251,12 +251,12 @@ class WikiExporter { # One, and only one hook should set this, and return false if( wfRunHooks( 'WikiExporter::dumpStableQuery', array(&$tables,&$opts,&$join) ) ) { wfProfileOut( __METHOD__ ); - return new WikiError( __METHOD__." given invalid history dump type." ); + throw new MWException( __METHOD__." given invalid history dump type." ); } } else { # Uknown history specification parameter? wfProfileOut( __METHOD__ ); - return new WikiError( __METHOD__." given invalid history dump type." ); + throw new MWException( __METHOD__." given invalid history dump type." ); } # Query optimization hacks if( $cond == '' ) {