github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/kbfs/search/errors.go (about)

     1  // Copyright 2020 Keybase Inc. All rights reserved.
     2  // Use of this source code is governed by a BSD
     3  // license that can be found in the LICENSE file.
     4  
     5  package search
     6  
     7  import (
     8  	"fmt"
     9  
    10  	"github.com/keybase/client/go/kbfs/data"
    11  	"github.com/keybase/client/go/kbfs/kbfsmd"
    12  	"github.com/keybase/client/go/kbfs/tlf"
    13  )
    14  
    15  // RevisionGCdError indicates that a revision has been
    16  // garbage-collected and cannot be indexed.
    17  type RevisionGCdError struct {
    18  	TlfID     tlf.ID
    19  	Rev       kbfsmd.Revision
    20  	LastGCRev kbfsmd.Revision
    21  }
    22  
    23  func (e RevisionGCdError) Error() string {
    24  	return fmt.Sprintf(
    25  		"Revision %d for TLF %s is too old to index (last gc rev=%d)",
    26  		e.Rev, e.TlfID, e.LastGCRev)
    27  }
    28  
    29  // OldPtrNotFound indicates that the old pointer for a given file
    30  // couldn't be found in the index.
    31  type OldPtrNotFound struct {
    32  	OldPtr data.BlockPointer
    33  }
    34  
    35  func (e OldPtrNotFound) Error() string {
    36  	return fmt.Sprintf("Old pointer %s not found in the index", e.OldPtr)
    37  }