From: Stephane Bisson Date: Tue, 1 Nov 2016 14:51:13 +0000 (-0400) Subject: DBError expects IDatabase|null as its first argument X-Git-Tag: 1.31.0-rc.0~4986^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=e87858e4f3442700b20a00b5d93098dce02eed49;p=lhc%2Fweb%2Fwiklou.git DBError expects IDatabase|null as its first argument I came across LBFactory.php:357 while testing my master/replica db setup. It was not configured correctly and I got "Argument 1 passed to DBExpectedError::__construct() must implement interface IDatabase, string given" instead of the actual error. Change-Id: I949e1803f84459f8bb83e957a88d1e927cad16f7 --- diff --git a/includes/libs/rdbms/exception/DBAccessError.php b/includes/libs/rdbms/exception/DBAccessError.php index c00082c530..864dea0ee0 100644 --- a/includes/libs/rdbms/exception/DBAccessError.php +++ b/includes/libs/rdbms/exception/DBAccessError.php @@ -25,6 +25,6 @@ */ class DBAccessError extends DBUnexpectedError { public function __construct() { - parent::__construct( "Database access has been disabled." ); + parent::__construct( null, "Database access has been disabled." ); } } diff --git a/includes/libs/rdbms/lbfactory/LBFactory.php b/includes/libs/rdbms/lbfactory/LBFactory.php index d21289be1a..4fb5b383df 100644 --- a/includes/libs/rdbms/lbfactory/LBFactory.php +++ b/includes/libs/rdbms/lbfactory/LBFactory.php @@ -355,6 +355,7 @@ abstract class LBFactory implements ILBFactory { if ( $failed ) { throw new DBReplicationWaitError( + null, "Could not wait for replica DBs to catch up to " . implode( ', ', $failed ) );