honeypot_check(&data.honeypot)?;
if !is_valid_post_title(&data.name) {
- return Err(ApiError::err("invalid_post_title").into());
+ return Err(ApiError::err_plain("invalid_post_title").into());
}
check_community_ban(local_user_view.person.id, data.community_id, context.pool()).await?;
"couldnt_create_post"
};
- return Err(ApiError::err(err_type).into());
+ return Err(ApiError::err(err_type, e).into());
}
};
Ok(Post::update_ap_id(conn, inserted_post_id, apub_id)?)
})
.await?
- .map_err(|_| ApiError::err("couldnt_create_post"))?;
+ .map_err(|e| ApiError::err("couldnt_create_post", e))?;
CreateOrUpdatePost::send(
&updated_post,
let like = move |conn: &'_ _| PostLike::like(conn, &like_form);
if blocking(context.pool(), like).await?.is_err() {
- return Err(ApiError::err("couldnt_like_post").into());
+ return Err(ApiError::err_plain("couldnt_like_post").into());
}
// Mark the post as read