update for latest micro changes

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2024-03-25 22:54:25 +03:00
parent ec5c6c591d
commit c362702c40
17 changed files with 1106 additions and 1043 deletions

View File

@@ -16,17 +16,18 @@ func (h *Handler) CommentDelete(ctx context.Context, req *pb.CommentDeleteReq, r
err := req.Validate()
if err != nil {
logger.Error(ctx, err)
logger.Error(ctx, "validate error", err)
httpsrv.SetRspCode(ctx, http.StatusBadRequest)
return httpsrv.SetError(NewValidationError(err))
}
if err = h.store.CommentDelete(ctx, req); err != nil {
logger.Error(ctx, err)
if errors.Is(err, sql.ErrNoRows) {
httpsrv.SetRspCode(ctx, http.StatusNotFound)
return httpsrv.SetError(NewNotFoundError(err))
}
logger.Error(ctx, "comment delete error", err)
httpsrv.SetRspCode(ctx, http.StatusInternalServerError)
return httpsrv.SetError(NewInternalError(err))
}