You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
kratos/middleware/status/status_test.go

17 lines
357 B

package status
import (
"context"
"testing"
"github.com/go-kratos/kratos/v2/errors"
)
func TestErrEncoder(t *testing.T) {
err := errors.BadRequest("test", "invalid_argument", "format")
en := encodeErr(context.Background(), err)
de := decodeErr(context.Background(), en)
if !errors.IsBadRequest(de) {
t.Errorf("expected %v got %v", err, de)
}
}