jenkins-bot has submitted this change and it was merged.
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(-)
Approvals:
Smalyshev: Looks good to me, approved
jenkins-bot: Verified
Objections:
Cindy-the-browser-test-bot: There's a problem with this change, please improve
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: merged
Gerrit-Change-Id: Iedc0ba3146a8ca0850c275b46dc4515ce5fb08d6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>
Gerrit-Reviewer: Cindy-the-browser-test-bot <[email protected]>
Gerrit-Reviewer: DCausse <[email protected]>
Gerrit-Reviewer: Gehel <[email protected]>
Gerrit-Reviewer: Manybubbles <[email protected]>
Gerrit-Reviewer: Smalyshev <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits