[MediaWiki-commits] [Gerrit] mediawiki...ZeroPortal[wmf/1.29.0-wmf.17]: Failure to parse json config should result in a usable error

2017-03-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
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: Ic460cb41e3e794f08dc11b3d25bced981f87
(cherry picked from commit 7874723a3cc3f76d93d6e8fff417cafe4bfff2d2)
---
M includes/ApiZeroPortal.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Thcipriani: Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: Ic460cb41e3e794f08dc11b3d25bced981f87
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ZeroPortal
Gerrit-Branch: wmf/1.29.0-wmf.17
Gerrit-Owner: Thcipriani 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Thcipriani 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...ZeroPortal[wmf/1.29.0-wmf.17]: Failure to parse json config should result in a usable error

2017-03-22 Thread Thcipriani (Code Review)
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: Ic460cb41e3e794f08dc11b3d25bced981f87
(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: Ic460cb41e3e794f08dc11b3d25bced981f87
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ZeroPortal
Gerrit-Branch: wmf/1.29.0-wmf.17
Gerrit-Owner: Thcipriani 
Gerrit-Reviewer: Chad 

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