better error messages

This commit is contained in:
Timofey Gelazoniya 2023-04-03 04:59:02 +03:00
parent 37137c3e84
commit 0b7549c2b6
Signed by: zeldon
GPG Key ID: 047886915281DD2A
1 changed files with 3 additions and 6 deletions

View File

@ -7,15 +7,12 @@ use crate::utilities::{
pub async fn liquid_rescale_processor(multipart: Multipart) -> Result<Vec<u8>, AppError> {
let image = parse_image(multipart).await.map_err(|err| {
error!("Error parse image: {:?}", err);
AppError::new(
StatusCode::INTERNAL_SERVER_ERROR,
"There was a error parse your image",
)
error!("Error in the multipart data parsing: {:?}", err);
AppError::new(StatusCode::INTERNAL_SERVER_ERROR, "Missing file field")
})?;
let image_data = liquid_rescale_image(&image).map_err(|err| {
error!("Imagemagick parse image error: {:?}", err);
error!("Imagemagick error: {:?}", err);
AppError::new(
StatusCode::INTERNAL_SERVER_ERROR,
"There was a error read your image",