micro/server/errors_test.go
Vasiliy Tolstov 5eb0e56373 move all imports to own domain
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-10-02 19:55:07 +03:00

20 lines
300 B
Go

package server
import (
"testing"
"go.unistack.org/micro/v3/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")
}
}