From 948b0710f27457a8545c5672e338a48145b34e7c Mon Sep 17 00:00:00 2001 From: Zaptoss Date: Wed, 12 Jun 2024 16:31:27 +0300 Subject: [PATCH] Fix error handling --- internal/service/handlers/verify_passport.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/service/handlers/verify_passport.go b/internal/service/handlers/verify_passport.go index 090d8d0..34adbc5 100644 --- a/internal/service/handlers/verify_passport.go +++ b/internal/service/handlers/verify_passport.go @@ -194,9 +194,12 @@ func fulfillPassportScanEvent(r *http.Request, balance data.Balance, country dat event, err = EventsQ(r). FilterByID(event.ID). Update(data.EventFulfilled, nil, nil) + if err != nil { + return fmt.Errorf("failed to update event: %w", err) + } if !evTypePassport.AutoClaim || !country.ReserveAllowed || country.Reserved >= country.ReserveLimit { - return err + return nil } _, err = claimEventWithPoints(r, *event, evTypePassport.Reward, &balance)