pass micro errors from grpc server to grpc client (#1167)
* pass micro errors from grpc server to grpc client Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * wrap micro errors.Error to grpc status Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -8,13 +8,7 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// Error implements the error interface.
|
||||
type Error struct {
|
||||
Id string `json:"id"`
|
||||
Code int32 `json:"code"`
|
||||
Detail string `json:"detail"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
//go:generate protoc -I. --go_out=paths=source_relative:. errors.proto
|
||||
|
||||
func (e *Error) Error() string {
|
||||
b, _ := json.Marshal(e)
|
||||
|
Reference in New Issue
Block a user