https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114256

Revision: 114256
Author:   qchris
Date:     2012-03-20 11:53:35 +0000 (Tue, 20 Mar 2012)
Log Message:
-----------
Follow up to r114252: Removing asserts

Modified Paths:
--------------
    trunk/phase3/maintenance/dumpTextPass.php

Modified: trunk/phase3/maintenance/dumpTextPass.php
===================================================================
--- trunk/phase3/maintenance/dumpTextPass.php   2012-03-20 11:50:00 UTC (rev 
114255)
+++ trunk/phase3/maintenance/dumpTextPass.php   2012-03-20 11:53:35 UTC (rev 
114256)
@@ -87,8 +87,13 @@
                        $this->lb->closeAll();
                        unset( $this->lb );
                }
-               assert( '! isset( $this->db ) || ! $this->db->isOpen() /* DB is 
either unset, or been closed via LB */' );
+               
+               if ( isset( $this->db ) && $this->db->isOpen() )
+                 {
+                         throw new MWException( 'DB is set and has not been 
closed by the Load Balancer' );
+                 }
 
+
                unset( $this->db );
 
                // Trying to set up new connection.
@@ -435,7 +440,6 @@
                                        throw new MWException( "Generic error 
while obtaining text for id " . $id );
                                }
 
-                               assert( '$text !== false' );
                                // We received a good candidate for the text of 
$id via some method
                                
                                // Step 2: Checking for plausibility and return 
the text if it is
@@ -452,12 +456,9 @@
                                        return $text;
                                }
                                
-                               assert( 'strlen( $text ) != $revLength /* 
Obtained text unplausible */' );
                                $text = false;
                                throw new MWException( "Received text is 
unplausible for id " . $id );
 
-                               assert( 'false /* text is either returned or 
exception has been thrown */' );
-
                        } catch (Exception $e) {
                                $msg = "getting/checking text " . $id . " 
failed (".$e->getMessage().")";
                                if ( $failures + 1 < $this->maxFailures ) {


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to