remove some http hard code (#2047)

Co-authored-by: yonbiaoxiao <yonbiaoxiao@tencent.com>
This commit is contained in:
xyb
2020-10-18 12:58:38 +08:00
committed by GitHub
parent 07b32ad3b9
commit 2e45567e56
6 changed files with 12 additions and 11 deletions

View File

@@ -428,11 +428,11 @@ func writeError(w http.ResponseWriter, r *http.Request, err error) {
switch ce.Code {
case 0:
// assuming it's totally screwed
ce.Code = 500
ce.Code = http.StatusInternalServerError
ce.Id = "go.micro.api"
ce.Status = http.StatusText(500)
ce.Status = http.StatusText(http.StatusInternalServerError)
ce.Detail = "error during request: " + ce.Detail
w.WriteHeader(500)
w.WriteHeader(http.StatusInternalServerError)
default:
w.WriteHeader(int(ce.Code))
}