r92250 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92249‎ | r92250 | r92251 >
Date:16:59, 15 July 2011
Author:demon
Status:ok
Tags:
Comment:
Slightly more informative error message when passed a bogus key (rather than property of non-object)
Modified paths:
  • /trunk/phase3/includes/upload/UploadStash.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/upload/UploadStash.php
@@ -353,6 +353,10 @@
354354 __METHOD__
355355 );
356356
 357+ if( !$row ) {
 358+ throw new UploadStashNoSuchKeyException( "No such key ($key), cannot remove" );
 359+ }
 360+
357361 if ( $row->us_user != $this->userId ) {
358362 throw new UploadStashWrongOwnerException( "Can't delete: the file ($key) doesn't belong to this user." );
359363 }
@@ -690,3 +694,4 @@
691695 class UploadStashNotLoggedInException extends MWException {};
692696 class UploadStashWrongOwnerException extends MWException {};
693697 class UploadStashMaxLagExceededException extends MWException {};
 698+class UploadStashNoSuchKeyException extends MWException {};

Status & tagging log