better error messages
This commit is contained in:
parent
37137c3e84
commit
0b7549c2b6
|
@ -7,15 +7,12 @@ use crate::utilities::{
|
||||||
|
|
||||||
pub async fn liquid_rescale_processor(multipart: Multipart) -> Result<Vec<u8>, AppError> {
|
pub async fn liquid_rescale_processor(multipart: Multipart) -> Result<Vec<u8>, AppError> {
|
||||||
let image = parse_image(multipart).await.map_err(|err| {
|
let image = parse_image(multipart).await.map_err(|err| {
|
||||||
error!("Error parse image: {:?}", err);
|
error!("Error in the multipart data parsing: {:?}", err);
|
||||||
AppError::new(
|
AppError::new(StatusCode::INTERNAL_SERVER_ERROR, "Missing file field")
|
||||||
StatusCode::INTERNAL_SERVER_ERROR,
|
|
||||||
"There was a error parse your image",
|
|
||||||
)
|
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let image_data = liquid_rescale_image(&image).map_err(|err| {
|
let image_data = liquid_rescale_image(&image).map_err(|err| {
|
||||||
error!("Imagemagick parse image error: {:?}", err);
|
error!("Imagemagick error: {:?}", err);
|
||||||
AppError::new(
|
AppError::new(
|
||||||
StatusCode::INTERNAL_SERVER_ERROR,
|
StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
"There was a error read your image",
|
"There was a error read your image",
|
||||||
|
|
Loading…
Reference in New Issue