Handle file name error in DELETE
API route
#20
Labels
enhancement
New feature or request
error handling
More helpful and transparent error handling/logging
web api
Changes to the API exposed via HTTP endpoints
Requesting
DELETE
from the/api/file/<hash><ext>
endpoint currently provides no feedback, as to whether the storage node even controls a file with the provided hash/extension at all. If it does not, a warning is logged, but the client receives the same200
response either way.videbo/src/videbo/storage/file_controller.py
Lines 410 to 417 in e7b53e0
No feedback/guarantees about successful deletion makes sense, but if the client application provided an invalid/unknown hash, it would be polite to respond accordingly. In this case, a
404
seems appropriate. The client is still free to ignore such a status code, but it may also be valuable information, in case there is a bug on the other end.@larsbonczek What do you think? The way I see it, there are no implications for
mod_videoservice
because it already ignores any non-200
response to a deletion request anyway. If anything, this is an opportunity to log this specific404
response on that end, too. That way we could more easily identify problems in setups with multiple LMS connected to one Videbo server. We always want to make sure that a file is only deleted, if it is no longer needed on any registered LMS. Better logging in the deletion process just seems like a good idea. (That is a topic formod_videoservice
, I just wanted to share my motivation for this issue here.)The text was updated successfully, but these errors were encountered: