Skip to content

Commit

Permalink
fix: grpc encoder could return status error
Browse files Browse the repository at this point in the history
  • Loading branch information
amanbolat committed Jul 1, 2024
1 parent a62d068 commit 34e561e
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions zegrpc/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ func NewSimpleEncoder(statusCode codes.Code, statusMessage string) SimpleEncoder
}

func (e SimpleEncoder) Encode(err error) *status.Status {
statusErr, ok := status.FromError(err)
if ok {
return statusErr
}

var zedErr *zeerr.Error
if errors.As(err, &zedErr) {
return status.New(zedErr.GRPCCode(), zedErr.Message())
Expand All @@ -60,11 +55,6 @@ func NewFullEncoder(statusCode codes.Code, statusMessage string) SimpleEncoder {
}

func (e FullEncoder) Encode(err error) *status.Status {
statusErr, ok := status.FromError(err)
if ok {
return statusErr
}

var zedErr *zeerr.Error
if errors.As(err, &zedErr) {
pbErr := e.encode(zedErr)
Expand Down

0 comments on commit 34e561e

Please sign in to comment.