mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-10-15 19:21:57 +00:00
feat: Produce a more informative error when uploading media fails
This commit is contained in:
parent
d38f4a24f2
commit
20f741d0e5
1 changed files with 6 additions and 2 deletions
|
@ -64,10 +64,14 @@ pub(crate) async fn create_content_route(
|
|||
media_id: &utils::random_string(MXC_LENGTH),
|
||||
};
|
||||
|
||||
services
|
||||
if let Err(e) = services
|
||||
.media
|
||||
.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(|| {
|
||||
services
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue