Thcipriani has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/344190 )

Change subject: Failure to parse json config should result in a usable error
......................................................................

Failure to parse json config should result in a usable error

Invalid config is bad, and needs resolution. A warning isn't nearly
enough information about what's failing and why

Change-Id: I9999c460cb41e3e794f08dc11b3d25bced981f87
(cherry picked from commit 7874723a3cc3f76d93d6e8fff417cafe4bfff2d2)
---
M includes/ApiZeroPortal.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ZeroPortal 
refs/changes/90/344190/1

diff --git a/includes/ApiZeroPortal.php b/includes/ApiZeroPortal.php
index 5d8db13..f2adc29 100644
--- a/includes/ApiZeroPortal.php
+++ b/includes/ApiZeroPortal.php
@@ -6,6 +6,7 @@
 use ApiFormatBase;
 use ApiMain;
 use ApiResult;
+use Exception;
 use FauxRequest;
 use JsonConfig\JCSingleton;
 use stdClass;
@@ -339,9 +340,8 @@
                                                        $content = 
JCSingleton::parseContent( $titleValue, $rev['*'] );
                                                        if ( !$content || 
!$content->isValid() ) {
                                                                if ( 
!$hasWarnings ) {
-                                                                       
wfLogWarning( 'ZeroAPI: Unable to parse json of page ' .
+                                                                       throw 
new Exception( 'ZeroAPI: Unable to parse json of page ' .
                                                                                
                  $page['title'] );
-                                                                       
$hasWarnings = true; // only log once per api request
                                                                }
                                                                continue;
                                                        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9999c460cb41e3e794f08dc11b3d25bced981f87
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ZeroPortal
Gerrit-Branch: wmf/1.29.0-wmf.17
Gerrit-Owner: Thcipriani <tcipri...@wikimedia.org>
Gerrit-Reviewer: Chad <ch...@wikimedia.org>

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

Reply via email to