Skip to content

Commit

Permalink
fix: add check for relay connection error
Browse files Browse the repository at this point in the history
  • Loading branch information
rolznz committed Jan 5, 2024
1 parent d0b270d commit dc6a62c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions service.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ func (svc *Service) StartSubscription(ctx context.Context, sub *nostr.Subscripti
}()

<-ctx.Done()
if sub.Relay.ConnectionError != nil {
svc.Logger.Errorf("Relay error %v", ctx.Err())
return sub.Relay.ConnectionError
}
if ctx.Err() != context.Canceled {
svc.Logger.Errorf("Subscription error %v", ctx.Err())
return ctx.Err()
Expand Down

0 comments on commit dc6a62c

Please sign in to comment.