mw.Upload.BookletLayout: Move error checking for uploadToStash to uploadFile
authorPrateek Saxena <prtksxna@gmail.com>
Wed, 30 Sep 2015 19:38:38 +0000 (01:08 +0530)
committerPrtksxna <psaxena@wikimedia.org>
Wed, 30 Sep 2015 19:55:44 +0000 (19:55 +0000)
commit887fedc500a304a9b8e4ff57c372b44a2fc4bd25
tree33b4671f19ee97d177d748f5e56e718809aa9446
parentce1d95166fceea8341a7ddf54d87021f2f83cf30
mw.Upload.BookletLayout: Move error checking for uploadToStash to uploadFile

We were checking for uploadToStash errors in saveFile, instead of in
uploadFile itself. Apart from being just wrong it was causing two
issues:

1. We would show an upload error until after you've tried to save the
   file.

2. If there was an error in saving, and you try again, the first thing
   it would do is check mw.Upload.State to hopefully check for
   uploadToStash errors. Instead of running the finishStashUpload again
   it would fail because of the earlier error, thus making all errors
   unrecoverable.

Bug: T114130
Change-Id: I56f4ef6e6536840a63402688eb2a1875a6876fcc
resources/src/mediawiki/mediawiki.Upload.BookletLayout.js