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:
2020-02-06 13:18:33 +03:00
committed by GitHub
parent d8110b70a3
commit 7105e4099c
7 changed files with 227 additions and 29 deletions

View File

@@ -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)