mirror of https://github.com/perkeep/perkeep.git
set error status code in serveRecentPermanodes
Change-Id: If7e982b1c35700823ca181e1331e404766a9ebd5
This commit is contained in:
parent
b0dda5e86f
commit
03e2da9f9a
|
@ -170,6 +170,7 @@ func (sh *Handler) serveRecentPermanodes(rw http.ResponseWriter, req *http.Reque
|
||||||
func (sh *Handler) servePermanodesWithAttr(rw http.ResponseWriter, req *http.Request) {
|
func (sh *Handler) servePermanodesWithAttr(rw http.ResponseWriter, req *http.Request) {
|
||||||
ret := jsonMap()
|
ret := jsonMap()
|
||||||
defer httputil.ReturnJson(rw, ret)
|
defer httputil.ReturnJson(rw, ret)
|
||||||
|
defer setPanicError(ret)
|
||||||
|
|
||||||
signer := blobref.MustParse(mustGet(req, "signer"))
|
signer := blobref.MustParse(mustGet(req, "signer"))
|
||||||
value := mustGet(req, "value")
|
value := mustGet(req, "value")
|
||||||
|
@ -221,8 +222,8 @@ func (sh *Handler) servePermanodesWithAttr(rw http.ResponseWriter, req *http.Req
|
||||||
|
|
||||||
err := <-errch
|
err := <-errch
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// TODO(mpl): return error status code, in addition to the english error code
|
|
||||||
ret["error"] = err.String()
|
ret["error"] = err.String()
|
||||||
|
ret["errorType"] = "server"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue