(bug 26379) Make the importImages.php maintenance script give useful error
authorBrian Wolff <bawolff@users.mediawiki.org>
Tue, 21 Dec 2010 04:46:49 +0000 (04:46 +0000)
committerBrian Wolff <bawolff@users.mediawiki.org>
Tue, 21 Dec 2010 04:46:49 +0000 (04:46 +0000)
messages on failure. (as in pass along the errors generated from publish() )

RELEASE-NOTES
maintenance/importImages.php

index a682b9d..6ab0b93 100644 (file)
@@ -35,6 +35,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 19006) {{REVISIONUSER}} no longer acts like {{CURRENTUSER}} in some cases
 * (bug 16019) $wgArticlePath = "/$1" no longer breaks API edit/watch actions
 * (bug 18372) File types blacklisted by $wgFileBlacklist will no longer be shown as "Permitted file types" on the upload form
+* (bug 26379) importImages.php gives more descriptive error message on failure.
 
 === API changes in 1.18 ===
 * (bug 26339) Throw warning when truncating an overlarge API result
index ff1e3e5..cc713db 100644 (file)
@@ -212,7 +212,9 @@ if ( count( $args ) > 0 ) {
                        } else {
                                $archive = $image->publish( $file );
                                if ( !$archive->isGood() ) {
-                                       echo( "failed.\n" );
+                                       echo( "failed. (" .
+                                               $archive->getWikiText() .
+                                               ")\n" );
                                        $failed++;
                                        continue;
                                }
@@ -258,7 +260,7 @@ if ( count( $args ) > 0 ) {
                                }
 
                        } else {
-                               echo( "failed.\n" );
+                               echo( "failed. (at recordUpload stage)\n" );
                                $svar = 'failed';
                        }