Skip to content

Commit

Permalink
fix: error message
Browse files Browse the repository at this point in the history
  • Loading branch information
bookpanda committed Jun 30, 2024
1 parent 34994cd commit 98e0bfe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/checkin/checkin.service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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{
Expand All @@ -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{
Expand Down

0 comments on commit 98e0bfe

Please sign in to comment.