Aaron Schulz has uploaded a new change for review.

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

Change subject: Make Swift iterators throw errors on failure
......................................................................

Make Swift iterators throw errors on failure

This is in line with FSFileBackend and is provides the calling
loop of a way to know the listing failed, rather than just
giving incomplete information.

Change-Id: I34c66d9dbf84e5f33982d17e61364c1595d3e9f7
---
M includes/filebackend/SwiftFileBackend.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/66/251666/1

diff --git a/includes/filebackend/SwiftFileBackend.php 
b/includes/filebackend/SwiftFileBackend.php
index 8097549..72a877d 100644
--- a/includes/filebackend/SwiftFileBackend.php
+++ b/includes/filebackend/SwiftFileBackend.php
@@ -861,7 +861,7 @@
                if ( !empty( $params['topOnly'] ) ) {
                        $status = $this->objectListing( $fullCont, 'names', 
$limit, $after, $prefix, '/' );
                        if ( !$status->isOk() ) {
-                               return $dirs; // error
+                               throw new FileBackendError( "Iterator page I/O 
error: {$status->getMessage()}" );
                        }
                        $objects = $status->value;
                        foreach ( $objects as $object ) { // files and 
directories
@@ -880,7 +880,7 @@
                        $status = $this->objectListing( $fullCont, 'names', 
$limit, $after, $prefix );
 
                        if ( !$status->isOk() ) {
-                               return $dirs; // error
+                               throw new FileBackendError( "Iterator page I/O 
error: {$status->getMessage()}" );
                        }
 
                        $objects = $status->value;
@@ -956,7 +956,7 @@
 
                // Reformat this list into a list of (name, stat array or null) 
entries
                if ( !$status->isOk() ) {
-                       return $files; // error
+                       throw new FileBackendError( "Iterator page I/O error: 
{$status->getMessage()}" );
                }
 
                $objects = $status->value;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I34c66d9dbf84e5f33982d17e61364c1595d3e9f7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

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

Reply via email to