From 12709d364bc84271bbc841569642127e2595c70b Mon Sep 17 00:00:00 2001 From: Jeff Date: Fri, 30 Aug 2019 18:54:00 -0400 Subject: [PATCH] catch case --- contrib/backends/srndv2/src/srnd/frontend_http.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/contrib/backends/srndv2/src/srnd/frontend_http.go b/contrib/backends/srndv2/src/srnd/frontend_http.go index 798ce79..4953e48 100644 --- a/contrib/backends/srndv2/src/srnd/frontend_http.go +++ b/contrib/backends/srndv2/src/srnd/frontend_http.go @@ -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 { cid, ok := sess.Values["captcha_id"] if ok {