Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Currently most of the errors you can encounter while/after uploading mods are "swallowed".
These are for example problems saving a zipball due to the reoccurring storage problem, an invalid zipfile, internal server errors and so on.
What happens now is that error messages are actually returned by the server/api, but the client/frontend is not able to display them (or better, throws an exception trying to display them), and thus the frontend stays in an incomplete state, where the user can't see what actually happens or already happened behind the scenes. It appears to load infinitely, as often reported in the forums.
Solution
The JavaScript code is re-ordered to
first check if there's a valid JSON response by the server,
a) if yes, check if result.error is false
a.a) if yes, everything's fine! Upload succeeded, redirect to the main mod page.
a.b) if no, take the supplied error message and show it.
b) if no valid JSON is given, this means that it's probably an connection error to the server or the backend threw an error handling the upload request.
We check the returned status code and show a more or less appropriate message.
It should no longer load to infinity after errors, instead a message should be shown, and the user can act based on it (in the best case, they inform us...)
I also extended the upload backend code a bit to catch
IOError
s when trying to save the zip file and return a more direct message.I hope this is the one that is returned when the samba storage locks up again.
The Dockerfiles were version-locked down to the patch level, and were often already pretty outdated. I removed the patch part, so that they auto-update a little bit, within the given minor version.
Doesn't affect prod/beta/alpha, since we don't use the Docker containers there, so only local dev envs.