summary refs log tree commit diff
path: root/synapse/rest/media/v1/media_storage.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-02-19 10:46:18 +0000
committerErik Johnston <erik@matrix.org>2021-02-19 10:46:18 +0000
commit3d2acc930f0a633bf400c96f3e636b5b662a54cb (patch)
treeb1ea0bb16319371cf2fedc199a948bc2bf9bd547 /synapse/rest/media/v1/media_storage.py
parentNewsfile (diff)
downloadsynapse-3d2acc930f0a633bf400c96f3e636b5b662a54cb.tar.xz
Return a 404 if we don't have the original file
Diffstat (limited to 'synapse/rest/media/v1/media_storage.py')
-rw-r--r--synapse/rest/media/v1/media_storage.py2
1 files changed, 1 insertions, 1 deletions
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.