From 50e3dea2ee18c514ba2e55fb0ad80106c7013e50 Mon Sep 17 00:00:00 2001 From: Tony Chen Date: Wed, 9 Jun 2021 10:48:29 +0800 Subject: [PATCH] fix errors proto (#1020) --- cmd/kratos/internal/proto/client/client.go | 2 +- errors/errors.proto | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/kratos/internal/proto/client/client.go b/cmd/kratos/internal/proto/client/client.go index 637528acc..c11f8fc41 100644 --- a/cmd/kratos/internal/proto/client/client.go +++ b/cmd/kratos/internal/proto/client/client.go @@ -78,8 +78,8 @@ func generate(proto string, args []string) error { path, name := filepath.Split(proto) input := []string{ "--proto_path=.", + "--proto_path=" + base.KratosMod(), "--proto_path=" + filepath.Join(base.KratosMod(), "third_party"), - "--proto_path=" + filepath.Join(base.KratosMod(), "errors"), "--go_out=paths=source_relative:.", "--go-grpc_out=paths=source_relative:.", "--go-http_out=paths=source_relative:.", diff --git a/errors/errors.proto b/errors/errors.proto index 47aca4a96..ff6766b49 100644 --- a/errors/errors.proto +++ b/errors/errors.proto @@ -9,6 +9,13 @@ option objc_class_prefix = "KratosErrors"; import "google/protobuf/descriptor.proto"; +message Error { + int32 code = 1; + string reason = 2; + string message = 3; + map metadata = 4; +}; + extend google.protobuf.EnumOptions { int32 default_code = 1108; } @@ -16,10 +23,3 @@ extend google.protobuf.EnumOptions { extend google.protobuf.EnumValueOptions { int32 code = 1109; } - -message Error { - int32 code = 1; - string reason = 2; - string message = 3; - map metadata = 4; -};