Flush errors upon entering the error callback.