]> Untitled Git - lemmy.git/blobdiff - crates/api_crud/src/comment/update.rs
Rework error handling (fixes #1714) (#2135)
[lemmy.git] / crates / api_crud / src / comment / update.rs
index 334181f25a46d27ae66e32f1a4b59502489cca3b..4fede14548e5f21a249c7e3c15e8e07e81c37436 100644 (file)
@@ -70,8 +70,7 @@ impl PerformCrud for EditComment {
       Comment::update_content(conn, comment_id, &content_slurs_removed)
     })
     .await?
-    .map_err(LemmyError::from)
-    .map_err(|e| e.with_message("couldnt_update_comment"))?;
+    .map_err(|e| LemmyError::from_error_message(e, "couldnt_update_comment"))?;
 
     // Do the mentions / recipients
     let updated_comment_content = updated_comment.content.to_owned();