r77799 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77798‎ | r77799 | r77800 >
Date:13:57, 5 December 2010
Author:ialex
Status:ok
Tags:
Comment:
Converted WikiError to MWException so at least users can see the problem (nothing was checking the return value of WikiExporter::dumpFrom() and realted methods)
Modified paths:
  • /trunk/phase3/includes/Export.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Export.php
@@ -130,7 +130,7 @@
131131 public function pageByName( $name ) {
132132 $title = Title::newFromText( $name );
133133 if( is_null( $title ) ) {
134 - return new WikiError( "Can't export invalid title" );
 134+ throw new MWException( "Can't export invalid title" );
135135 } else {
136136 return $this->pageByTitle( $title );
137137 }
@@ -251,12 +251,12 @@
252252 # One, and only one hook should set this, and return false
253253 if( wfRunHooks( 'WikiExporter::dumpStableQuery', array(&$tables,&$opts,&$join) ) ) {
254254 wfProfileOut( __METHOD__ );
255 - return new WikiError( __METHOD__." given invalid history dump type." );
 255+ throw new MWException( __METHOD__." given invalid history dump type." );
256256 }
257257 } else {
258258 # Uknown history specification parameter?
259259 wfProfileOut( __METHOD__ );
260 - return new WikiError( __METHOD__." given invalid history dump type." );
 260+ throw new MWException( __METHOD__." given invalid history dump type." );
261261 }
262262 # Query optimization hacks
263263 if( $cond == '' ) {

Status & tagging log