handle possible http errors to save events