fix(services/january): remove image if video present and hence fix logic error

refactor(services/january): throw an error if embed fails to generate
This commit is contained in:
Paul Makles
2024-10-02 16:08:24 +01:00
parent 520fb02fb6
commit 58d3c5cc2e
5 changed files with 16 additions and 3 deletions

View File

@@ -80,6 +80,7 @@ impl IntoResponse for Error {
ErrorType::FileTooLarge { .. } => StatusCode::UNPROCESSABLE_ENTITY,
ErrorType::FileTypeNotAllowed => StatusCode::BAD_REQUEST,
ErrorType::ImageProcessingFailed => StatusCode::INTERNAL_SERVER_ERROR,
ErrorType::NoEmbedData => StatusCode::BAD_REQUEST,
};
(status, Json(&self)).into_response()