diff --git a/pkg/logstructured/logstructured.go b/pkg/logstructured/logstructured.go index 00749206..966ba6c9 100644 --- a/pkg/logstructured/logstructured.go +++ b/pkg/logstructured/logstructured.go @@ -437,7 +437,7 @@ func (l *LogStructured) Watch(ctx context.Context, prefix string, revision int64 wr.CompactRevision = compact wr.CurrentRevision = rev } else { - errc <- errors.New("failed to execute query in database") + errc <- server.ErrGRPCUnhealthy } } cancel() diff --git a/pkg/server/types.go b/pkg/server/types.go index 2dd1f94a..b1c2b168 100644 --- a/pkg/server/types.go +++ b/pkg/server/types.go @@ -12,9 +12,10 @@ import ( var ( ErrNotSupported = status.New(codes.InvalidArgument, "etcdserver: unsupported operations in txn request").Err() - ErrKeyExists = rpctypes.ErrGRPCDuplicateKey - ErrCompacted = rpctypes.ErrGRPCCompacted - ErrFutureRev = rpctypes.ErrGRPCFutureRev + ErrKeyExists = rpctypes.ErrGRPCDuplicateKey + ErrCompacted = rpctypes.ErrGRPCCompacted + ErrFutureRev = rpctypes.ErrGRPCFutureRev + ErrGRPCUnhealthy = rpctypes.ErrGRPCUnhealthy ) type Backend interface {