Commit 079a4113 authored by astaxie's avatar astaxie

when call middle.Exception should set w.WriteHeader first

parent e01fbd49
......@@ -294,6 +294,11 @@ func RegisterErrorHander() {
func Exception(errcode string, w http.ResponseWriter, r *http.Request, msg string) {
if h, ok := ErrorMaps[errcode]; ok {
isint, err := strconv.Atoi(errcode)
if err != nil {
isint = 500
}
w.WriteHeader(isint)
h(w, r)
return
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment