github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/engine/access/rpc/backend/errors.go (about)

     1  package backend
     2  
     3  import (
     4  	"errors"
     5  	"fmt"
     6  
     7  	"github.com/onflow/flow-go/model/flow"
     8  )
     9  
    10  // InsufficientExecutionReceipts indicates that no execution receipt were found for a given block ID
    11  type InsufficientExecutionReceipts struct {
    12  	blockID      flow.Identifier
    13  	receiptCount int
    14  }
    15  
    16  func (e InsufficientExecutionReceipts) Error() string {
    17  	return fmt.Sprintf("insufficient execution receipts found (%d) for block ID: %s", e.receiptCount, e.blockID.String())
    18  }
    19  
    20  func IsInsufficientExecutionReceipts(err error) bool {
    21  	var errInsufficientExecutionReceipts InsufficientExecutionReceipts
    22  	return errors.As(err, &errInsufficientExecutionReceipts)
    23  }