mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
feat: Produce a more informative error when uploading media fails
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user