From 96f03fb7205686d5d20e622efea4b07002cf24db Mon Sep 17 00:00:00 2001 From: Prateek Saxena Date: Tue, 6 Oct 2015 13:38:03 +0530 Subject: [PATCH] mw.Upload.BookletLayout: Add a catch all error state Bug: T114130 Change-Id: I6d74c8bb878d6364228838df1c060fcb77ebf3e6 --- .../src/mediawiki/mediawiki.Upload.BookletLayout.js | 11 +++++++++++ 1 file changed, 11 insertions(+) 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; -- 2.20.1