Catch all stash errors in cleanup script
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 4 Nov 2013 17:40:56 +0000 (09:40 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Mon, 4 Nov 2013 17:40:56 +0000 (09:40 -0800)
bug: 56401
Change-Id: I3dcd8728a46fdcbecbda0bdc6e3aef49e8f41ed8

maintenance/cleanupUploadStash.php

index c2ba555..ba7c3cf 100644 (file)
@@ -81,10 +81,9 @@ class UploadStashCleanup extends Maintenance {
                                try {
                                        $stash->getFile( $key, true );
                                        $stash->removeFileNoAuth( $key );
-                               } catch ( UploadStashBadPathException $ex ) {
-                                       $this->output( "Failed removing stashed upload with key: $key\n" );
-                               } catch ( UploadStashZeroLengthFileException $ex ) {
-                                       $this->output( "Failed removing stashed upload with key: $key\n" );
+                               } catch ( UploadStashException $ex ) {
+                                       $type = get_class( $ex );
+                                       $this->output( "Failed removing stashed upload with key: $key ($type)\n" );
                                }
                                if ( $i % 100 == 0 ) {
                                        $this->output( "$i\n" );