Skip to content

Commit a58d7dc

Browse files
Add status.Errorf
1 parent 2662236 commit a58d7dc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

grpc/status/status.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ func Error(c codes.Code, msg string) error {
1111
return extgrpc.WrapWithGrpcCode(errors.New(msg), c)
1212
}
1313

14+
func Errorf(c codes.Code, format string, args ...interface{}) error {
15+
return extgrpc.WrapWithGrpcCode(errors.Errorf(format, args...), c)
16+
}
17+
1418
func WrapErr(c codes.Code, msg string, err error) error {
1519
return extgrpc.WrapWithGrpcCode(errors.WrapWithDepth(1, err, msg), c)
1620
}

0 commit comments

Comments
 (0)