Repositories like onedrive or googledocs should stop throwing exceptions (especially in the send_file() method) and use sent_file_not_found() method (like it is done by other repositories).
Right now, an exception does not come with a 404 error so external clients doing downloads (via webservice/pluginfile) will receive a 200 code message and the exception message as the file contents.
send_file_not_found() is the right approach because:
- It sends a 404 (Not found) error, so any download by an external client will understand that the download failed
- It also includes an exception message
- It supports CORS
I'm not sure what's the best approach to implement this, maybe we should just wrap in a try / catch webservice/pluginfile.php and process the exception there?