0

这个简单的代码将只输入一次捕获。我怎样才能用try catch循环这个?

run(function* (gen) {
  while (true) {
    try {
      yield request('http://www.unexistanturl.com', gen());
    } catch (err) {
      debug(err);
    }
  }
})
4

1 回答 1

0
run(function* (gen) {
  while (true) {
      yield function(){
        try {
          request('http://www.unexistanturl.com', gen());
        } catch (err) {
          debug(err);
        }
      }();
  }
})
于 2013-07-17T18:05:06.360 回答