From a0d59875020700253e57f27adf07f8aa773bfee6 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 1 Feb 2021 10:52:15 -0500 Subject: [PATCH] Adding explicit parent comment errors. #1397 #1390 --- crates/api/src/comment.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/api/src/comment.rs b/crates/api/src/comment.rs index 56c0ce625..3bf844a38 100644 --- a/crates/api/src/comment.rs +++ b/crates/api/src/comment.rs @@ -70,10 +70,10 @@ impl Perform for CreateComment { let parent = match blocking(context.pool(), move |conn| Comment::read(&conn, parent_id)).await? { Ok(comment) => comment, - Err(_e) => return Err(APIError::err("couldnt_create_comment").into()), + Err(_e) => return Err(APIError::err("couldnt_find_parent_comment").into()), }; if parent.post_id != post_id { - return Err(APIError::err("couldnt_create_comment").into()); + return Err(APIError::err("parent_comment_not_in_post").into()); } }