feat: Produce a more informative error when uploading media fails

This commit is contained in:
nexy7574
2025-10-12 19:42:57 +00:00
committed by nex
parent d38f4a24f2
commit 20f741d0e5
+6 -2
View File
@@ -64,10 +64,14 @@ pub(crate) async fn create_content_route(
media_id: &utils::random_string(MXC_LENGTH), media_id: &utils::random_string(MXC_LENGTH),
}; };
services if let Err(e) = services
.media .media
.create(mxc, Some(user), Some(&content_disposition), content_type, &body.file) .create(mxc, Some(user), Some(&content_disposition), content_type, &body.file)
.await?; .await
{
err!("Failed to save uploaded media: {e}");
return Err!(Request(Unknown("Failed to save uploaded media")));
}
let blurhash = body.generate_blurhash.then(|| { let blurhash = body.generate_blurhash.then(|| {
services services