UploadWizard should handle network connection problems better.
Steps to reproduce:
- Visit https://commons.wikimedia.org/wiki/Special:UploadWizard
- Turn off your network connection [or check "Offline" in browser dev tools]
- Try to upload a file
Expected: an error saying that you're not connected.
Actual: an error saying "The server responded with an invalid JSON document. This could be a problem with the API, or you could be using a proxy server that prevents you from uploading files.".