You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
384 B

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