From 3d2acc930f0a633bf400c96f3e636b5b662a54cb Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 19 Feb 2021 10:46:18 +0000 Subject: Return a 404 if we don't have the original file --- synapse/rest/media/v1/media_storage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'synapse/rest/media/v1/media_storage.py') diff --git a/synapse/rest/media/v1/media_storage.py b/synapse/rest/media/v1/media_storage.py index 1057e638be..b1b1c9e6ec 100644 --- a/synapse/rest/media/v1/media_storage.py +++ b/synapse/rest/media/v1/media_storage.py @@ -244,7 +244,7 @@ class MediaStorage: await consumer.wait() return local_path - raise Exception("file could not be found") + raise NotFoundError() def _file_info_to_path(self, file_info: FileInfo) -> str: """Converts file_info into a relative path. -- cgit 1.5.1