Skip to content

Commit

Permalink
make storage error accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
jxsl13 committed Sep 15, 2024
1 parent 0e2dfe8 commit 70192be
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion snapshot7/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ const (
UninitializedTick = -1
)

var (
ErrNoAltInSnapStorage = errors.New("there is no alt snap in the storage")
)

// TODO: do we even need this?
//
// can we just put the snap as is in the map?
Expand Down Expand Up @@ -85,7 +89,7 @@ func (s *Storage) OldestTick() int {

func (s *Storage) altSnapshot() (*Snapshot, error) {
if s.altSnap.snap == nil {
return nil, errors.New("there is no alt snap in the storage")
return nil, ErrNoAltInSnapStorage
}
return s.altSnap.snap, nil
}
Expand Down

0 comments on commit 70192be

Please sign in to comment.