set error status code in serveRecentPermanodes

Change-Id: If7e982b1c35700823ca181e1331e404766a9ebd5
This commit is contained in:
mpl 2011-09-04 20:30:38 +02:00
parent b0dda5e86f
commit 03e2da9f9a
1 changed files with 2 additions and 1 deletions

View File

@ -170,6 +170,7 @@ func (sh *Handler) serveRecentPermanodes(rw http.ResponseWriter, req *http.Reque
func (sh *Handler) servePermanodesWithAttr(rw http.ResponseWriter, req *http.Request) {
ret := jsonMap()
defer httputil.ReturnJson(rw, ret)
defer setPanicError(ret)
signer := blobref.MustParse(mustGet(req, "signer"))
value := mustGet(req, "value")
@ -221,8 +222,8 @@ func (sh *Handler) servePermanodesWithAttr(rw http.ResponseWriter, req *http.Req
err := <-errch
if err != nil {
// TODO(mpl): return error status code, in addition to the english error code
ret["error"] = err.String()
ret["errorType"] = "server"
return
}