From 1b965e7ef58f6e6415e280600ad051d256dd5997 Mon Sep 17 00:00:00 2001 From: William Date: Tue, 20 Aug 2024 22:22:14 +0200 Subject: [PATCH] Fix minor error Signed-off-by: William --- internal/services/user_service.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/services/user_service.go b/internal/services/user_service.go index dc875fe..201342c 100644 --- a/internal/services/user_service.go +++ b/internal/services/user_service.go @@ -132,6 +132,10 @@ func (usrSrv *userService) Register(userRegistrationRequest models.UserRegistrat return false, err } tx, err := usrSrv.db.Begin() + if err != nil { + log.Println("Failed to start transaction") + return false, ErrRegistration + } defer tx.Rollback() queryString := ` INSERT INTO users