Daniel Kinzler has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/50171


Change subject: Fix fatal error due to unknown exception.
......................................................................

Fix fatal error due to unknown exception.

TermsSqlCache tired to throw an instance of Exception without
specifying a namespace, causing a fatal error. Changed that to
\MWException now.

Change-Id: Idbf67b96a64939e374cffb1f295ecb72137e5575
---
M repo/includes/store/sql/TermSqlCache.php
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/71/50171/1

diff --git a/repo/includes/store/sql/TermSqlCache.php 
b/repo/includes/store/sql/TermSqlCache.php
index 41ca54b..a43376b 100644
--- a/repo/includes/store/sql/TermSqlCache.php
+++ b/repo/includes/store/sql/TermSqlCache.php
@@ -295,11 +295,14 @@
 
                $numericIds = array();
                foreach ( $ids as $id ) {
-                       $numericIds[] = $id->getNumericId();
                        if ( $id->getEntityType() !== $entityType ) {
-                               throw new Exception( 'Declared EntityType must 
match the actual EntityType of each Entity' );
+                               throw new \MWException( "ID " . 
$id->getPrefixedId()
+                                       . " does not refer to an entity of type 
$entityType." );
                        }
+
+                       $numericIds[] = $id->getNumericId();
                }
+
                $entityIdentifiers['term_entity_id'] = $numericIds;
 
                $fields = array(

-- 
To view, visit https://gerrit.wikimedia.org/r/50171
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idbf67b96a64939e374cffb1f295ecb72137e5575
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler <[email protected]>

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

Reply via email to