From: Prateek Saxena Date: Tue, 6 Oct 2015 08:08:03 +0000 (+0530) Subject: mw.Upload.BookletLayout: Add a catch all error state X-Git-Tag: 1.31.0-rc.0~9500^2 X-Git-Url: http://git.cyclocoop.org/data/%24oldEdit?a=commitdiff_plain;h=96f03fb7205686d5d20e622efea4b07002cf24db;p=lhc%2Fweb%2Fwiklou.git mw.Upload.BookletLayout: Add a catch all error state Bug: T114130 Change-Id: I6d74c8bb878d6364228838df1c060fcb77ebf3e6 --- diff --git a/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js b/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js index b574a5d8fd..b0c696cc68 100644 --- a/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js +++ b/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js @@ -254,6 +254,9 @@ } if ( layout.upload.getState() === mw.Upload.State.WARNING ) { + // We could get more than one of these errors, these are in order + // of importance. For example fixing the thumbnail like file name + // won't help the fact that the file already exists. if ( stateDetails.exists !== undefined ) { deferred.reject( new OO.ui.Error( $( '

' ).html( @@ -297,6 +300,14 @@ mw.message( 'badfilename', stateDetails.badfilename ).parse() ) ) ); + } else { + deferred.reject( new OO.ui.Error( + $( '

' ).html( + // Let's get all the help we can if we can't pin point the error + mw.message( 'api-error-unknown-warning', JSON.stringify( stateDetails ) ).parse() + ), + { recoverable: false } + ) ); } return false;