missing error check in export

This commit is contained in:
Umputun
2017-12-24 18:10:17 -06:00
parent 012ff98de1
commit f94d79fd71
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
Comment engine
## Install
## Install
### Backend
+3 -1
View File
@@ -256,7 +256,9 @@ func (s *Server) voteCtrl(w http.ResponseWriter, r *http.Request) {
// GET /export?site=site-id
func (s *Server) exportCtrl(w http.ResponseWriter, r *http.Request) {
siteID := r.URL.Query().Get("site")
s.Exporter.Export(w, siteID)
if err := s.Exporter.Export(w, siteID); err != nil {
httpError(w, r, http.StatusInternalServerError, err, "export failed")
}
}
func httpError(w http.ResponseWriter, r *http.Request, code int, err error, details string) {