Archived
1
0

catch case

This commit is contained in:
Jeff 2019-08-30 18:54:00 -04:00
parent 34ce6f805a
commit 12709d364b

View File

@ -553,7 +553,16 @@ func (self *httpFrontend) handle_postform(wr http.ResponseWriter, r *http.Reques
} }
} }
sess, _ := self.store.Get(r, self.name) sess, err := self.store.Get(r, self.name)
if err != nil {
errmsg := fmt.Sprintf("session store error: %s", err.Error())
if sendJson {
json.NewEncoder(wr).Encode(map[string]interface{}{"error": errmsg})
} else {
io.WriteString(wr, errmsg)
}
return
}
if checkCaptcha && len(captcha_id) == 0 { if checkCaptcha && len(captcha_id) == 0 {
cid, ok := sess.Values["captcha_id"] cid, ok := sess.Values["captcha_id"]
if ok { if ok {