Gather more information about pre rendering 500s
authorGilles Dubuc <gdubuc@wikimedia.org>
Tue, 28 Jul 2015 14:57:18 +0000 (16:57 +0200)
committerGilles Dubuc <gdubuc@wikimedia.org>
Tue, 28 Jul 2015 14:57:18 +0000 (16:57 +0200)
Bug: T106740
Change-Id: I4a1436f1724fcc74d4c1076b21fcdb3b5d58b1de

includes/jobqueue/jobs/ThumbnailRenderJob.php

index a58fa8b..d1d9999 100644 (file)
@@ -50,7 +50,8 @@ class ThumbnailRenderJob extends Job {
                                        return false;
                                }
                        } elseif ( $wgUploadThumbnailRenderMethod === 'http' ) {
-                               $status = $this->hitThumbUrl( $file, $transformParams );
+                               $thumbUrl = '';
+                               $status = $this->hitThumbUrl( $file, $transformParams, $thumbUrl );
 
                                wfDebug( __METHOD__ . ": received status {$status}\n" );
 
@@ -59,7 +60,7 @@ class ThumbnailRenderJob extends Job {
                                } elseif ( $status ) {
                                        // Note that this currently happens (500) when requesting sizes larger then or
                                        // equal to the original, which is harmless.
-                                       $this->setLastError( __METHOD__ . ': incorrect HTTP status ' . $status );
+                                       $this->setLastError( __METHOD__ . ': incorrect HTTP status ' . $status . ' when hitting ' . $thumbUrl );
                                        return false;
                                } else {
                                        $this->setLastError( __METHOD__ . ': HTTP request failure' );
@@ -75,7 +76,7 @@ class ThumbnailRenderJob extends Job {
                }
        }
 
-       protected function hitThumbUrl( $file, $transformParams ) {
+       protected function hitThumbUrl( $file, $transformParams, &$thumbUrl ) {
                global $wgUploadThumbnailRenderHttpCustomHost, $wgUploadThumbnailRenderHttpCustomDomain;
 
                $thumbName = $file->thumbName( $transformParams );