micro/server/errors_test.go
Vasiliy Tolstov f3f2a9b737
Some checks failed
coverage / build (push) Failing after 56s
test / test (push) Successful in 2m30s
move to v4
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2025-01-25 15:48:10 +03:00

20 lines
300 B
Go

package server
import (
"testing"
"go.unistack.org/micro/v4/errors"
)
func TestError(t *testing.T) {
e := NewError("svc1")
err := e.BadRequest("%s", "test")
merr, ok := err.(*errors.Error)
if !ok {
t.Fatal("error not *errors.Error")
}
if merr.ID != "svc1" {
t.Fatal("id != svc1")
}
}