You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2021/09/29 09:20:42 UTC
[servicecomb-kie] branch master updated: modify error information
(#217)
This is an automated email from the ASF dual-hosted git repository.
littlecui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-kie.git
The following commit(s) were added to refs/heads/master by this push:
new 6cf7055 modify error information (#217)
6cf7055 is described below
commit 6cf7055d976b2515c8cdd7a8a44e2aac32cc66b2
Author: Sphairis <56...@users.noreply.github.com>
AuthorDate: Wed Sep 29 17:20:37 2021 +0800
modify error information (#217)
* modify error information
* fix bug
Co-authored-by: SphaIris <aaalixiaopei123>
---
proxy.sh | 2 +-
server/resource/v1/kv_resource.go | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/proxy.sh b/proxy.sh
index 5fcc641..234367a 100755
--- a/proxy.sh
+++ b/proxy.sh
@@ -13,4 +13,4 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-export GOPROXY=https://goproxy.io
+export GOPROXY=https://goproxy.cn
diff --git a/server/resource/v1/kv_resource.go b/server/resource/v1/kv_resource.go
index 54330a2..5caacd7 100644
--- a/server/resource/v1/kv_resource.go
+++ b/server/resource/v1/kv_resource.go
@@ -108,6 +108,10 @@ func (r *KVResource) Put(rctx *restful.Context) {
kv, err := kvsvc.Update(rctx.Ctx, kvReq)
if err != nil {
openlog.Error(fmt.Sprintf("put [%s] err:%s", kvID, err.Error()))
+ if err == datasource.ErrKeyNotExists {
+ WriteErrResponse(rctx, config.ErrRecordNotExists, err.Error())
+ return
+ }
WriteErrResponse(rctx, config.ErrInternal, "update kv failed")
return
}