tendermint/lite/proxy/errors.go
Marko 8a282a5fee replace errors.go with github.com/pkg/errors (2/2) (#3890)
* init of (2/2) common errors

* Remove instances of cmn.Error (2/2)

- Replace usage of cmnError and errorWrap
- ref #3862

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* comment wording

* simplify IsErrXXX functions

* log panic along with stopping the MConnection
2019-08-11 21:03:40 +04:00

22 lines
384 B
Go

package proxy
import (
"github.com/pkg/errors"
)
type errNoData struct{}
func (e errNoData) Error() string {
return "No data returned for query"
}
// IsErrNoData checks whether an error is due to a query returning empty data
func IsErrNoData(err error) bool {
_, ok := errors.Cause(err).(errNoData)
return ok
}
func ErrNoData() error {
return errors.Wrap(errNoData{}, "")
}