Remove never thrown UploadStashNotAvailableException
Also move creation of UploadStash to main entry point of the special page to avoid use of context before it is set (by called getUser). Change-Id: Ibcb17b6ee1b853d807f91104ba428b307e9a5208
This commit is contained in:
parent
3ba8243cd6
commit
50b1cd2fbc
4 changed files with 1 additions and 10 deletions
|
|
@ -1264,7 +1264,6 @@ $wgAutoloadLocalClasses = array(
|
|||
'UploadStashFileException' => __DIR__ . '/includes/upload/UploadStash.php',
|
||||
'UploadStashFileNotFoundException' => __DIR__ . '/includes/upload/UploadStash.php',
|
||||
'UploadStashNoSuchKeyException' => __DIR__ . '/includes/upload/UploadStash.php',
|
||||
'UploadStashNotAvailableException' => __DIR__ . '/includes/upload/UploadStash.php',
|
||||
'UploadStashNotLoggedInException' => __DIR__ . '/includes/upload/UploadStash.php',
|
||||
'UploadStashWrongOwnerException' => __DIR__ . '/includes/upload/UploadStash.php',
|
||||
'UploadStashZeroLengthFileException' => __DIR__ . '/includes/upload/UploadStash.php',
|
||||
|
|
|
|||
|
|
@ -62,8 +62,6 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo {
|
|||
$result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), $modulePrefix );
|
||||
}
|
||||
// @todo Update exception handling here to understand current getFile exceptions
|
||||
} catch ( UploadStashNotAvailableException $e ) {
|
||||
$this->dieUsage( "Session not available: " . $e->getMessage(), "nosession" );
|
||||
} catch ( UploadStashFileNotFoundException $e ) {
|
||||
$this->dieUsage( "File not found: " . $e->getMessage(), "invalidsessiondata" );
|
||||
} catch ( UploadStashBadPathException $e ) {
|
||||
|
|
|
|||
|
|
@ -48,10 +48,6 @@ class SpecialUploadStash extends UnlistedSpecialPage {
|
|||
|
||||
public function __construct() {
|
||||
parent::__construct( 'UploadStash', 'upload' );
|
||||
try {
|
||||
$this->stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash( $this->getUser() );
|
||||
} catch ( UploadStashNotAvailableException $e ) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -62,6 +58,7 @@ class SpecialUploadStash extends UnlistedSpecialPage {
|
|||
* @return bool Success
|
||||
*/
|
||||
public function execute( $subPage ) {
|
||||
$this->stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash( $this->getUser() );
|
||||
$this->checkPermissions();
|
||||
|
||||
if ( $subPage === null || $subPage === '' ) {
|
||||
|
|
|
|||
|
|
@ -727,9 +727,6 @@ class UploadStashFile extends UnregisteredLocalFile {
|
|||
class UploadStashException extends MWException {
|
||||
}
|
||||
|
||||
class UploadStashNotAvailableException extends UploadStashException {
|
||||
}
|
||||
|
||||
class UploadStashFileNotFoundException extends UploadStashException {
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue