add extra annotations

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2019-05-01 00:23:48 +08:00
committed by zryfish
parent 3e8035dc2b
commit 8e2acfa7f6
16 changed files with 162 additions and 59 deletions

View File

@@ -90,7 +90,12 @@ func DescribeWorkspace(req *restful.Request, resp *restful.Response) {
result, err := tenant.DescribeWorkspace(username, workspaceName)
if err != nil {
resp.WriteHeaderAndEntity(http.StatusInternalServerError, errors.Wrap(err))
glog.Errorf("describe workspace failed: %+v", err)
if k8serr.IsNotFound(err) {
resp.WriteHeaderAndEntity(http.StatusNotFound, errors.Wrap(err))
} else {
resp.WriteHeaderAndEntity(http.StatusInternalServerError, errors.Wrap(err))
}
return
}