Better error message when user runs out of storage
Description
When a user has run out of storage quota, this path will get triggered: https://github.com/learningequality/studio/blob/develop/contentcuration/contentcuration/views/internal.py#L134
Current state: Ricecooker currently exits:

Expected: handle error and print informative message to user (you have run out of storage)
Is it solved?
I don't think it's giving an informative error message still, as the exception is for any rejected request: https://github.com/learningequality/ricecooker/blob/213a3ca5ae47ce54dd72594184d6187020431a7b/ricecooker/managers/tree.py#L191
Noting that this doesn't prevent any of our retry behaviour, which we should do when there is insufficient storage.
We are also using a different endpoint now, so just checking for a status response of 412 might be sufficient (to see where that 412 is coming from, see here https://github.com/learningequality/studio/blob/unstable/contentcuration/contentcuration/viewsets/file.py#L163).
So, a solution here would be:
- In the else block where we just throw an exception (https://github.com/learningequality/ricecooker/blob/213a3ca5ae47ce54dd72594184d6187020431a7b/ricecooker/managers/tree.py#L191) we should check if the response status code is a 412, and raise a specific exception saying the user is out of storage space.
- Make sure this is propagating through the chain of calls of _handle_upload, upload_files, etc. and make sure we flag (maybe through an attribute on the ChannelManager object) that there is insufficient storage, so that we can raise an error in the main thread, and give a meaningful error to the user.
hey, is this issue still open? I would really like to work on it!
I have fixed the issue by adding an insufficient storage exception. Please review @rtibbles
Thanks @Divyanshi750!
Hi @rtibbles @MisRob,
I have closed the previous PR and raised a new one due to some technical difficulties. In this updated PR:
I have removed changes to unrelated files. I have added the audio-cache file to .gitignore, as requested. I sincerely apologize for raising a new PR and appreciate your understanding as I am new to the open-source community. Kindly review it when possible.
Thank you!
Thank you @Divyanshi750 - that is fine. In future, it is also OK to do a force push to the same branch to update the existing PR in this sort of case.
Fixed in #567