move errors to internal

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-09-28 12:14:53 +03:00
parent 83b3167030
commit c59d400857
6 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
package grpc package grpc
import ( import (
pberr "github.com/unistack-org/micro-client-grpc/errors" pb "github.com/unistack-org/micro-client-grpc/internal/errors"
"github.com/unistack-org/micro/v3/errors" "github.com/unistack-org/micro/v3/errors"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
) )
@ -17,7 +17,7 @@ func microError(err error) error {
return verr return verr
} }
if verr, ok := err.(*pberr.Error); ok { if verr, ok := err.(*pb.Error); ok {
return &errors.Error{Id: verr.Id, Code: verr.Code, Detail: verr.Detail, Status: verr.Status} return &errors.Error{Id: verr.Id, Code: verr.Code, Detail: verr.Detail, Status: verr.Status}
} }

View File

@ -1,3 +1,3 @@
package grpc package grpc
//go:generate protoc -I./errors -I. --go-grpc_out=paths=source_relative:./errors --go_out=paths=source_relative:./errors --micro_out=paths=source_relative:./errors errors/errors.proto //go:generate protoc -I./internal/errors -I. --go-grpc_out=paths=source_relative:./internal/errors --go_out=paths=source_relative:./internal/errors --micro_out=paths=source_relative:./internal/errors internal/errors/errors.proto