From 98e0bfe09fff6620bc691ce8b87cd3035492afe5 Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Sun, 30 Jun 2024 22:52:57 +0700 Subject: [PATCH] fix: error message --- internal/checkin/checkin.service.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/checkin/checkin.service.go b/internal/checkin/checkin.service.go index 6396249..4f3e850 100644 --- a/internal/checkin/checkin.service.go +++ b/internal/checkin/checkin.service.go @@ -35,7 +35,7 @@ func (s *serviceImpl) Create(_ context.Context, req *proto.CreateCheckInRequest) err := s.repo.Create(checkin) if err != nil { s.log.Named("Create").Error("Create: ", zap.Error(err)) - return nil, status.Error(codes.Internal, "internal error") + return nil, status.Error(codes.Internal, "Cannot create checkin: "+err.Error()) } return &proto.CreateCheckInResponse{ @@ -47,7 +47,7 @@ func (s *serviceImpl) FindByEmail(_ context.Context, req *proto.FindByEmailCheck var checkins []*model.CheckIn if err := s.repo.FindByEmail(req.Email, &checkins); err != nil { s.log.Named("FindByEmail").Error("FindByEmail: ", zap.Error(err)) - return nil, status.Error(codes.Internal, "internal error") + return nil, status.Error(codes.Internal, "Cannot find checkin: "+err.Error()) } return &proto.FindByEmailCheckInResponse{ @@ -59,7 +59,7 @@ func (s *serviceImpl) FindByUserId(_ context.Context, req *proto.FindByUserIdChe var checkins []*model.CheckIn if err := s.repo.FindByUserId(req.UserId, &checkins); err != nil { s.log.Named("FindByUserId").Error("FindByUserId: ", zap.Error(err)) - return nil, status.Error(codes.Internal, "internal error") + return nil, status.Error(codes.Internal, "Cannot find checkin: "+err.Error()) } return &proto.FindByUserIdCheckInResponse{