Skip to content

Commit

Permalink
chore: handle errors
Browse files Browse the repository at this point in the history
  • Loading branch information
im-adithya committed Nov 8, 2024
1 parent 8b18359 commit a275855
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions internal/nostr/expo.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,21 @@ func (svc *Service) handleSubscribedExpoNotification(event *nostr.Event, subscri
Priority: expo.DefaultPriority,
},
)

someerr := response.ValidateResponse()
if err != nil || someerr != nil {
svc.Logger.WithFields(logrus.Fields{
if err != nil {
svc.Logger.WithError(err).WithFields(logrus.Fields{
"push_token": subscription.PushToken,
}).Error("Failed to send expo notification")
return
}

err = response.ValidateResponse()
if err != nil {
svc.Logger.WithError(err).WithFields(logrus.Fields{
"push_token": subscription.PushToken,
}).Error("Failed to valid expo publish response")
return
}

svc.Logger.WithFields(logrus.Fields{
"event_id": event.ID,
"push_token": subscription.PushToken,
Expand Down

0 comments on commit a275855

Please sign in to comment.