diff --git a/src/routes.rs b/src/routes.rs index da349a6..2210f93 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -127,7 +127,7 @@ pub async fn put_object( body.extend_from_slice(&chunk); } - let entry = serde_json::from_slice::(&body)?; + let entry = serde_json::from_slice::(&body).map_err(ErrorBadRequest)?; let result_address = insert_entry(&connection, entry).map_err(ErrorInternalServerError)?;