micro-client-drpc/error.go
Vasiliy Tolstov 296625b820 update all
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-09-12 23:51:45 +03:00

26 lines
365 B
Go

package drpc
import (
"github.com/unistack-org/micro/v3/errors"
)
func microError(err error) error {
// no error
if err == nil {
return nil
}
if verr, ok := err.(*errors.Error); ok {
return verr
}
// fallback
return &errors.Error{
Id: "go.micro.client",
Code: 500,
Detail: err.Error(),
// Status: http.StatusInternalServerError,
}
}