r104396 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104395‎ | r104396 | r104397 >
Date:05:50, 28 November 2011
Author:tstarling
Status:ok
Tags:
Comment:
More debugging info in some error cases
Modified paths:
  • /trunk/extensions/VipsScaler/SpecialVipsTest.php (modified) (history)

Diff [purge]

Index: trunk/extensions/VipsScaler/SpecialVipsTest.php
@@ -242,23 +242,23 @@
243243 # Validate title and file existance
244244 $title = Title::makeTitleSafe( NS_FILE, $request->getText( 'thumb' ) );
245245 if ( is_null( $title ) ) {
246 - return $this->streamError( 404 );
 246+ return $this->streamError( 404, "VipsScaler: invalid title\n" );
247247 }
248248 $file = wfFindFile( $title );
249249 if ( !$file || !$file->exists() ) {
250 - return $this->streamError( 404 );
 250+ return $this->streamError( 404, "VipsScaler: file not found\n" );
251251 }
252252
253253 # Check if vips can handle this file
254254 if ( VipsScaler::getVipsHandler( $file ) === false ) {
255 - return $this->streamError( 500 );
 255+ return $this->streamError( 500, "VipsScaler: VIPS cannot handle this file type\n" );
256256 }
257257
258258 # Validate param string
259259 $handler = $file->getHandler();
260260 $params = array( 'width' => $request->getInt( 'width' ) );
261261 if ( !$handler->normaliseParams( $file, $params ) ) {
262 - return $this->streamError( 500 );
 262+ return $this->streamError( 500, "VipsScaler: invalid parameters\n" );
263263 }
264264
265265

Status & tagging log