diff --git a/src/app/utils/matrix.ts b/src/app/utils/matrix.ts index 9df0aed79..6cc26ae02 100644 --- a/src/app/utils/matrix.ts +++ b/src/app/utils/matrix.ts @@ -299,6 +299,7 @@ export const mxcUrlToHttp = ( export const downloadMedia = async (src: string): Promise => { // this request is authenticated by service worker const res = await fetch(src, { method: 'GET' }); + if (!res.ok) throw new Error(`Media download failed: ${res.status} ${res.statusText}`); const blob = await res.blob(); return blob; };