do not panic on client 400

master
Bel LaPointe 2023-10-11 16:18:27 -06:00
parent 9416613627
commit 874ff7ccaa
1 changed files with 3 additions and 1 deletions

View File

@ -54,7 +54,9 @@ func (server Server) serveGetEvents(w http.ResponseWriter, r *http.Request) {
sinceString := r.URL.Query().Get("since")
sinceInt, err := strconv.ParseInt(sinceString, 10, 64)
if err != nil {
panic(err)
// todo emit helpful err message
w.WriteHeader(http.StatusBadRequest)
return nil
}
since := time.Unix(sinceInt, 0)