This is an automated email from the ASF dual-hosted git repository.

tianxiaoliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git


The following commit(s) were added to refs/heads/master by this push:
     new 111228f  compatible kie-client error (#1156)
111228f is described below

commit 111228f128e38f34c64d5e3cc9d6debd63f97e89
Author: Sphairis <[email protected]>
AuthorDate: Tue Sep 28 15:16:34 2021 +0800

    compatible kie-client error (#1156)
    
    * compatible kie-client error
    
    * fix bug
    
    Co-authored-by: SphaIris <aaalixiaopei123>
---
 go.mod                              | 2 +-
 go.sum                              | 2 ++
 scripts/build/tools.sh              | 2 +-
 server/resource/gov/gov_resource.go | 6 ++++++
 4 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/go.mod b/go.mod
index 4983028..decece8 100644
--- a/go.mod
+++ b/go.mod
@@ -13,7 +13,7 @@ require (
        github.com/go-chassis/foundation v0.3.1-0.20210811025651-7f4d2b2b906c
        github.com/go-chassis/go-archaius v1.5.1
        github.com/go-chassis/go-chassis/v2 v2.3.0
-       github.com/go-chassis/kie-client v0.1.1-0.20210731071824-96f1f1e47e71
+       github.com/go-chassis/kie-client v0.1.1-0.20210926011742-97eed4281056
        github.com/go-chassis/openlog v1.1.3
        github.com/go-kit/kit v0.10.0 // indirect
        github.com/golang-jwt/jwt v3.2.1+incompatible
diff --git a/go.sum b/go.sum
index 12ed649..d66c20c 100644
--- a/go.sum
+++ b/go.sum
@@ -280,6 +280,8 @@ github.com/go-chassis/go-restful-swagger20 v1.0.3/go.mod 
h1:eW62fYuzlNFDvIacB6AV
 github.com/go-chassis/kie-client v0.0.0-20201210060018-938c7680a9ab/go.mod 
h1:UTdbtyN5ge/v9DmQzdVRxQP7z51Q4z6hyl+W6ZpUHFM=
 github.com/go-chassis/kie-client v0.1.1-0.20210731071824-96f1f1e47e71 
h1:3ZRlumK36aVzLzHVp9Y7RsEYK0qMwX/enD7xU6ntj78=
 github.com/go-chassis/kie-client v0.1.1-0.20210731071824-96f1f1e47e71/go.mod 
h1:UTdbtyN5ge/v9DmQzdVRxQP7z51Q4z6hyl+W6ZpUHFM=
+github.com/go-chassis/kie-client v0.1.1-0.20210926011742-97eed4281056 
h1:Y8CyErFNg4d1dPYXvNWxpyzzLQ/kuyuxJF2/7My7qLc=
+github.com/go-chassis/kie-client v0.1.1-0.20210926011742-97eed4281056/go.mod 
h1:N4SrGTb+e9ZiuOOU9vC/AohqsDtCkY2amNAPcvpEem0=
 github.com/go-chassis/openlog v1.1.2/go.mod 
h1:+eYCADVxWyJkwsFMUBrMxyQlNqW+UUsCxvR2LrYZUaA=
 github.com/go-chassis/openlog v1.1.3 
h1:XqIOvZ8YPJ9o9lLtLBskQNNWolK5kC6a4Sv7r4s9sZ4=
 github.com/go-chassis/openlog v1.1.3/go.mod 
h1:+eYCADVxWyJkwsFMUBrMxyQlNqW+UUsCxvR2LrYZUaA=
diff --git a/scripts/build/tools.sh b/scripts/build/tools.sh
index 883723f..07d8b92 100644
--- a/scripts/build/tools.sh
+++ b/scripts/build/tools.sh
@@ -20,7 +20,7 @@
 set -e
 
 # GO flags
-export GOPROXY=${GOPROXY:-"https://goproxy.io"}
+export GOPROXY=${GOPROXY:-"https://goproxy.cn"}
 export GOOS=${GOOS:-"linux"}
 export GOARCH=${GOARCH:-"amd64"}
 export CGO_ENABLED=${CGO_ENABLED:-0} # prevent to compile cgo file
diff --git a/server/resource/gov/gov_resource.go 
b/server/resource/gov/gov_resource.go
index bbf451d..c50d58b 100644
--- a/server/resource/gov/gov_resource.go
+++ b/server/resource/gov/gov_resource.go
@@ -29,6 +29,7 @@ import (
        "github.com/apache/servicecomb-service-center/server/service/gov"
        "github.com/apache/servicecomb-service-center/server/service/gov/kie"
        "github.com/go-chassis/cari/discovery"
+       "github.com/go-chassis/cari/pkg/errsvc"
 )
 
 type Governance struct {
@@ -172,6 +173,11 @@ func (t *Governance) Delete(w http.ResponseWriter, r 
*http.Request) {
 
 func processError(w http.ResponseWriter, err error, msg string) {
        log.Error(msg, err)
+       formatErr, ok := err.(*errsvc.Error)
+       if ok {
+               rest.WriteError(w, formatErr.Code, formatErr.Message)
+               return
+       }
        rest.WriteError(w, discovery.ErrInternal, err.Error())
 }
 

Reply via email to