Add error catch if the db goes up and down during polling