Skip to content

Commit

Permalink
panic less often
Browse files Browse the repository at this point in the history
  • Loading branch information
cristaloleg committed Jul 23, 2024
1 parent 9cb41db commit 1a0ed39
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ func (s *Store[H]) Height() uint64 {

head, err := s.Head(ctx)
if err != nil {
if errors.Is(err, context.Canceled) ||
errors.Is(err, datastore.ErrNotFound) {
return 0
}
panic(err)
}
return head.Height()
Expand Down

0 comments on commit 1a0ed39

Please sign in to comment.