Skip to content

Commit

Permalink
change custom error to ErrGRPCUnhealthy
Browse files Browse the repository at this point in the history
Signed-off-by: Nic <qianyong@api7.ai>
  • Loading branch information
nic-6443 committed Dec 6, 2024
1 parent 5e1d414 commit f23c1dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/logstructured/logstructured.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
7 changes: 4 additions & 3 deletions pkg/server/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f23c1dc

Please sign in to comment.