Skip to content

Commit

Permalink
fix: remove duplicated error check
Browse files Browse the repository at this point in the history
  • Loading branch information
frnandu committed Oct 29, 2024
1 parent 9f69b1a commit 0d61bb2
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions nip47/event_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,6 @@ func (svc *nip47Service) HandleEvent(ctx context.Context, relay nostrmodels.Rela
return
}

if err != nil {
logger.Logger.WithFields(logrus.Fields{
"requestEventNostrId": event.ID,
"eventKind": event.Kind,
}).WithError(err).Error("Failed to compute shared secret")
return
}

// store request event
requestEvent := db.RequestEvent{AppId: nil, NostrId: event.ID, State: db.REQUEST_EVENT_STATE_HANDLER_EXECUTING}
err = svc.db.Create(&requestEvent).Error
Expand Down Expand Up @@ -106,7 +98,7 @@ func (svc *nip47Service) HandleEvent(ctx context.Context, relay nostrmodels.Rela
logger.Logger.WithFields(logrus.Fields{
"requestEventNostrId": event.ID,
"eventKind": event.Kind,
}).WithError(err).Error("Failed to process event")
}).WithError(err).Error("Failed to compute shared secret")

requestEvent.State = db.REQUEST_EVENT_STATE_HANDLER_ERROR
err = svc.db.Save(&requestEvent).Error
Expand Down

0 comments on commit 0d61bb2

Please sign in to comment.