forked from TrueCloudLab/frostfs-api-go
service: test coverage for wrapped status errors
This commit is contained in:
parent
d08f5a5811
commit
a893e389b0
1 changed files with 13 additions and 0 deletions
|
@ -3,6 +3,7 @@ package service
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/stretchr/testify/require"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
|
@ -54,6 +55,18 @@ func TestMetaRequest(t *testing.T) {
|
|||
RequestMetaHeader: RequestMetaHeader{TTL: SingleForwardingTTL},
|
||||
handler: func(_ uint32) error { return status.Error(codes.NotFound, "not found") },
|
||||
},
|
||||
{
|
||||
msg: "not found",
|
||||
code: codes.NotFound,
|
||||
name: "custom wrapped status error",
|
||||
RequestMetaHeader: RequestMetaHeader{TTL: SingleForwardingTTL},
|
||||
handler: func(_ uint32) error {
|
||||
err := status.Error(codes.NotFound, "not found")
|
||||
err = errors.Wrap(err, "some error context")
|
||||
err = errors.Wrap(err, "another error context")
|
||||
return err
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for i := range tests {
|
||||
|
|
Loading…
Reference in a new issue