jenkins-bot has submitted this change and it was merged.

Change subject: Stop logging when rows can't be formatted because of permission 
exception
......................................................................


Stop logging when rows can't be formatted because of permission exception

This is very noisy in the logs.

Change-Id: Iaa51c35ef19ee0789a24449ed05fa74ef29e65c0
---
M Hooks.php
1 file changed, 7 insertions(+), 2 deletions(-)

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



diff --git a/Hooks.php b/Hooks.php
index e115ab0..963595b 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -429,13 +429,18 @@
                        /** @var Flow\Formatter\ChangesListFormatter $formatter 
*/
                        $formatter = Container::get( 'formatter.changeslist' );
                        $line = $formatter->format( $row, $changesList, 
$topicOnly );
+               } catch ( PermissionException $pe ) {
+                       // It is expected that some rows won't be formatted 
because the current user
+                       // doesn't have permission to see some of the data they 
contain.
+                       return false;
                } catch ( Exception $e ) {
                        wfDebugLog( 'Flow', __METHOD__ . ': Exception 
formatting rc ' . $rc->getAttribute( 'rc_id' ) . ' ' . $e );
                        MWExceptionHandler::logException( $e );
-                       restore_error_handler();
                        return false;
                }
-               restore_error_handler();
+               finally {
+                       restore_error_handler();
+               }
 
                if ( $line === false ) {
                        return false;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaa51c35ef19ee0789a24449ed05fa74ef29e65c0
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Sbisson <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to