Skip to content

Commit

Permalink
Improve powerstore error handling (#676)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien authored Sep 30, 2024
1 parent c438aa5 commit 6c0427f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/powerstore/powerstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ func (ps *Store) run(ctx context.Context) error {
f3Base, _, err := ps.f3PowerBase(ctx)
if err != nil {
log.Errorw("failed to determine f3 base epoch", "error", err)
continue
}
ecHeadTs, err := ps.GetHead(ctx)
if err != nil {
Expand Down Expand Up @@ -339,11 +340,11 @@ func (ps *Store) get(ctx context.Context, epoch int64) (certs.PowerTableDiff, er
}
buf, err := ps.ds.Get(ctx, ps.dsKeyForDiff(epoch))
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to lookup powertable delta for epoch %d: %w", epoch, err)
}
var diff certs.PowerTableDiff
if err := diff.UnmarshalCBOR(bytes.NewReader(buf)); err != nil {
return nil, err
return nil, fmt.Errorf("failed to decode powertable delta for epoch %d: %w", epoch, err)
}

return diff, nil
Expand Down

0 comments on commit 6c0427f

Please sign in to comment.