From e87858e4f3442700b20a00b5d93098dce02eed49 Mon Sep 17 00:00:00 2001 From: Stephane Bisson Date: Tue, 1 Nov 2016 10:51:13 -0400 Subject: [PATCH] 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 --- includes/libs/rdbms/exception/DBAccessError.php | 2 +- includes/libs/rdbms/lbfactory/LBFactory.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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 ) ); -- 2.20.1