You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing a simple script to open multiple webpages in multiple tabs. I'm running into a problem where if one of the pages doesn't load successfully with error 'Failed to load url' every promise after that rejects with 'Failed to load url'. I'm wondering why it's not just getting over the fact that one tab opening failed and refuse to run anymore unrelated operations!
script:
var Horseman = require('node-horseman');
var co = require('co');
var horseman = new Horseman();
var links = ['https://www.hotjar.com/blog','https://insights.hotjar.com/register','https://www.hotjar.com'];
co(function *(){
for (var link of links) {
try {
yield horseman.openTab(link);
}
catch(err) {
console.log(`error opening a tab: ${link} ${err}`);
}
}
try {
var tabCount = yield horseman.tabCount();
console.log(tabCount);
}
catch(err) {
console.log("can't get tab count: " + err);
}
try {
var url = yield horseman.switchToTab(0).url();
console.log(url);
}
catch(err) {
console.log("can't get first tab's url: " + err);
}
return url;
}).then(function(r){
console.log('result:');
console.log(r);
})
.catch(function(e){
console.log("final error handler: " + e);
});
I'm writing a simple script to open multiple webpages in multiple tabs. I'm running into a problem where if one of the pages doesn't load successfully with error 'Failed to load url' every promise after that rejects with 'Failed to load url'. I'm wondering why it's not just getting over the fact that one tab opening failed and refuse to run anymore unrelated operations!
script:
Output of: DEBUG=horseman BLUEBIRD_DEBUG=1 node co.js
using node/6.10.3
The text was updated successfully, but these errors were encountered: