This simple code would enter the catch just once. How can I loop this with the try catch?
run(function* (gen) {
while (true) {
try {
yield request('http://www.unexistanturl.com', gen());
} catch (err) {
debug(err);
}
}
})
run(function* (gen) {
while (true) {
yield function(){
try {
request('http://www.unexistanturl.com', gen());
} catch (err) {
debug(err);
}
}();
}
})
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.