dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d508962
)
Changed storeResult to storeStatus (more informative), removed leftover stack trace...
author
Ian Baker
<raindrift@users.mediawiki.org>
Mon, 25 Jul 2011 16:55:19 +0000
(16:55 +0000)
committer
Ian Baker
<raindrift@users.mediawiki.org>
Mon, 25 Jul 2011 16:55:19 +0000
(16:55 +0000)
includes/upload/UploadStash.php
patch
|
blob
|
history
diff --git
a/includes/upload/UploadStash.php
b/includes/upload/UploadStash.php
index
fc02132
..
9304ce5
100644
(file)
--- a/
includes/upload/UploadStash.php
+++ b/
includes/upload/UploadStash.php
@@
-219,18
+219,18
@@
class UploadStash {
wfDebug( __METHOD__ . " key for '$path': $key\n" );
// if not already in a temporary area, put it there
wfDebug( __METHOD__ . " key for '$path': $key\n" );
// if not already in a temporary area, put it there
- $store
Result
= $this->repo->storeTemp( basename( $path ), $path );
+ $store
Status
= $this->repo->storeTemp( basename( $path ), $path );
- if ( ! $store
Result
->isOK() ) {
+ if ( ! $store
Status
->isOK() ) {
// It is a convention in MediaWiki to only return one error per API exception, even if multiple errors
// are available. We use reset() to pick the "first" thing that was wrong, preferring errors to warnings.
// It is a convention in MediaWiki to only return one error per API exception, even if multiple errors
// are available. We use reset() to pick the "first" thing that was wrong, preferring errors to warnings.
- // This is a bit lame, as we may have more info in the $store
Result
and we're throwing it away, but to fix it means
+ // This is a bit lame, as we may have more info in the $store
Status
and we're throwing it away, but to fix it means
// redesigning API errors significantly.
// redesigning API errors significantly.
- // $store
Result
->value just contains the virtual URL (if anything) which is probably useless to the caller
- $error = $store
Result
->getErrorsArray();
+ // $store
Status
->value just contains the virtual URL (if anything) which is probably useless to the caller
+ $error = $store
Status
->getErrorsArray();
$error = reset( $error );
if ( ! count( $error ) ) {
$error = reset( $error );
if ( ! count( $error ) ) {
- $error = $store
Result
->getWarningsArray();
+ $error = $store
Status
->getWarningsArray();
$error = reset( $error );
if ( ! count( $error ) ) {
$error = array( 'unknown', 'no error recorded' );
$error = reset( $error );
if ( ! count( $error ) ) {
$error = array( 'unknown', 'no error recorded' );
@@
-238,11
+238,10
@@
class UploadStash {
}
throw new UploadStashFileException( "error storing file in '$path': " . implode( '; ', $error ) );
}
}
throw new UploadStashFileException( "error storing file in '$path': " . implode( '; ', $error ) );
}
- $stashPath = $store
Result
->value;
+ $stashPath = $store
Status
->value;
// fetch the current user ID
if ( !$this->isLoggedIn ) {
// fetch the current user ID
if ( !$this->isLoggedIn ) {
- wfDebugCallstack();
throw new UploadStashNotLoggedInException( __METHOD__ . ' No user is logged in, files must belong to users' );
}
throw new UploadStashNotLoggedInException( __METHOD__ . ' No user is logged in, files must belong to users' );
}