Dan-nl has uploaded a new change for review.

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


Change subject: add-tmp-path-info
......................................................................

add-tmp-path-info

moving the exception to the uploadMediaFileViaUploadFromUrl method so that we
can log the temp path as well.

Change-Id: I41b654b2b6a4741068959a4b60c36b2f22a91ca2
---
M includes/Handlers/UploadHandler.php
1 file changed, 16 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GWToolset 
refs/changes/92/100692/1

diff --git a/includes/Handlers/UploadHandler.php 
b/includes/Handlers/UploadHandler.php
index 501320b..300f239 100644
--- a/includes/Handlers/UploadHandler.php
+++ b/includes/Handlers/UploadHandler.php
@@ -470,14 +470,7 @@
                }
 
                if ( !$Status->isOK() ) {
-                       $msg =
-                               $Status->getMessage() . PHP_EOL .
-                               'original URL: ' .
-                               
$this->_MediawikiTemplate->mediawiki_template_array['gwtoolset-url-to-the-media-file']
 .
-                               PHP_EOL .
-                               'evaluated URL: ' . 
$options['gwtoolset-url-to-the-media-file'];
-
-                       throw new GWTException( $msg );
+                       throw new GWTException( $Status->getMessage() );
                }
 
                return $Title;
@@ -544,6 +537,7 @@
         *
         * @param {array} $options
         * @param {Title} $Title
+        * @throws {GWTException}
         * @return {Status}
         */
        protected function uploadMediaFileViaUploadFromUrl( array &$options, 
Title $Title ) {
@@ -576,6 +570,20 @@
                        $this->_User
                );
 
+               if ( !$Status->isOK() ) {
+                       $msg =
+                               $Status->getMessage() . PHP_EOL .
+                               'tmp path: ' . $Upload->getTempPath() . PHP_EOL 
.
+                               'original URL: ' .
+                               Utils::sanitizeUrl(
+                                       
$this->_MediawikiTemplate->mediawiki_template_array['gwtoolset-url-to-the-media-file']
+                               ) . PHP_EOL .
+                               'evaluated URL: ' .
+                               Utils::sanitizeUrl( 
$options['gwtoolset-url-to-the-media-file'] ) . PHP_EOL;
+
+                       throw new GWTException( $msg );
+               }
+
                return $Status;
        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41b654b2b6a4741068959a4b60c36b2f22a91ca2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GWToolset
Gerrit-Branch: master
Gerrit-Owner: Dan-nl <[email protected]>

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

Reply via email to