# HG changeset patch # User Sascha L. Teichmann # Date 1533551780 -7200 # Node ID 889517f254f580ae0374deaf6740fd97038b8217 # Parent 4c211ad5349ea583a6e1b1d6f4e8e67fcdf34612 Use code of JSONError as HTTP code. diff -r 4c211ad5349e -r 889517f254f5 controllers/json.go --- a/controllers/json.go Sun Aug 05 15:48:36 2018 +0200 +++ b/controllers/json.go Mon Aug 06 12:36:20 2018 +0200 @@ -74,7 +74,10 @@ } case JSONError: rw.Header().Set("Content-Type", "application/json") - rw.WriteHeader(http.StatusInternalServerError) + if e.Code == 0 { + e.Code = http.StatusInternalServerError + } + rw.WriteHeader(e.Code) var res = struct { Message string `json:"message"` }{