github.com/okex/exchain@v1.8.0/libs/tendermint/lite/proxy/errors.go (about)

     1  package proxy
     2  
     3  import (
     4  	"github.com/pkg/errors"
     5  )
     6  
     7  type errNoData struct{}
     8  
     9  func (e errNoData) Error() string {
    10  	return "No data returned for query"
    11  }
    12  
    13  // IsErrNoData checks whether an error is due to a query returning empty data
    14  func IsErrNoData(err error) bool {
    15  	_, ok := errors.Cause(err).(errNoData)
    16  	return ok
    17  }
    18  
    19  func ErrNoData() error {
    20  	return errors.Wrap(errNoData{}, "")
    21  }