EBernhardson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/282960
Change subject: Throw exception on unknown cluster
......................................................................
Throw exception on unknown cluster
If no configuration is available for the configured cluster we should
throw an exception. This still errors out deeper anyways, but failing
early makes debugging a bit easier and more obvious.
Bug: T132408
Change-Id: Iedc0ba3146a8ca0850c275b46dc4515ce5fb08d6
---
M includes/Connection.php
1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch
refs/changes/60/282960/1
diff --git a/includes/Connection.php b/includes/Connection.php
index 84dbf1a..9a24d33 100644
--- a/includes/Connection.php
+++ b/includes/Connection.php
@@ -158,6 +158,9 @@
return $this->config->get( 'CirrusSearchServers' );
}
$config = $this->config->getElement( 'CirrusSearchClusters',
$this->cluster );
+ if ( $config === null ) {
+ throw new \RuntimeException( "No configuration
available for cluster: {$this->cluster}" );
+ }
// Elastica will only create transports from within it's own
// namespace. To use the CirrusSearch PooledHttp(s) this
--
To view, visit https://gerrit.wikimedia.org/r/282960
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iedc0ba3146a8ca0850c275b46dc4515ce5fb08d6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits