dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "mw.Upload.BookletLayout: Don't explode when the API call fails with 'exception'"
[lhc/web/wiklou.git]
/
resources
/
src
/
mediawiki
/
mediawiki.Upload.BookletLayout.js
diff --git
a/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js
b/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js
index
84b33fd
..
4038228
100644
(file)
--- a/
resources/src/mediawiki/mediawiki.Upload.BookletLayout.js
+++ b/
resources/src/mediawiki/mediawiki.Upload.BookletLayout.js
@@
-169,6
+169,9
@@
} ).always( function () {
deferred.resolve();
} );
} ).always( function () {
deferred.resolve();
} );
+ } ).fail( function ( errorMsg ) {
+ booklet.getPage( 'upload' ).$element.msg( errorMsg );
+ deferred.resolve();
} );
return deferred.promise();
} );
return deferred.promise();
@@
-285,6
+288,14
@@
warnings = stateDetails.upload && stateDetails.upload.warnings;
if ( state === mw.Upload.State.ERROR ) {
warnings = stateDetails.upload && stateDetails.upload.warnings;
if ( state === mw.Upload.State.ERROR ) {
+ if ( !error ) {
+ // If there's an 'exception' key, this might be a timeout, or other connection problem
+ return new OO.ui.Error(
+ $( '<p>' ).msg( 'api-error-unknownerror', JSON.stringify( stateDetails ) ),
+ { recoverable: false }
+ );
+ }
+
// HACK We should either have a hook here to allow TitleBlacklist to handle this, or just have
// TitleBlacklist produce sane error messages that can be displayed without arcane knowledge
if ( error.info === 'TitleBlacklist prevents this title from being created' ) {
// HACK We should either have a hook here to allow TitleBlacklist to handle this, or just have
// TitleBlacklist produce sane error messages that can be displayed without arcane knowledge
if ( error.info === 'TitleBlacklist prevents this title from being created' ) {