Yaron Koren has submitted this change and it was merged.

Change subject: Added try-catch block around CargoSQLQuery creation
......................................................................


Added try-catch block around CargoSQLQuery creation

Change-Id: I9082936092dd205cd6682de391886e51e8c754bf
---
M parserfunctions/CargoQuery.php
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Yaron Koren: Verified; Looks good to me, approved



diff --git a/parserfunctions/CargoQuery.php b/parserfunctions/CargoQuery.php
index 6f1a76f..c286673 100644
--- a/parserfunctions/CargoQuery.php
+++ b/parserfunctions/CargoQuery.php
@@ -59,8 +59,12 @@
                        }
                }
 
-               $sqlQuery = CargoSQLQuery::newFromValues( $tablesStr, 
$fieldsStr, $whereStr, $joinOnStr,
+               try {
+                       $sqlQuery = CargoSQLQuery::newFromValues( $tablesStr, 
$fieldsStr, $whereStr, $joinOnStr,
                                $groupByStr, $orderByStr, $limitStr );
+               } catch ( Exception $e ) {
+                       return CargoUtils::formatError( $e->getMessage() );
+               }
                $queryDisplayer = CargoQueryDisplayer::newFromSQLQuery( 
$sqlQuery );
                $queryDisplayer->mFormat = $format;
                $queryDisplayer->mDisplayParams = $displayParams;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9082936092dd205cd6682de391886e51e8c754bf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <yaro...@gmail.com>
Gerrit-Reviewer: Yaron Koren <yaro...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to