server.go: Handle errors on inserting individual events

This commit is contained in:
Aaron Lindsay 2013-03-17 23:04:23 -04:00
parent 4fda36f75e
commit ad8156210f

View File

@ -126,7 +126,11 @@ func putEvents(w http.ResponseWriter, r *http.Request) {
return
}
for _, event := range events.Events {
DatabaseAddEvent(db, event)
err = DatabaseAddEvent(db, event)
if err != nil {
error_message = err.Error()
return
}
}
broadcastToPollers("aclindsa", events.Events[0]) //TODO support more than one user