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
console.log('\x1b[36m%s\x1b[0m','\n SUCCESS : all item(s) links crawled.');
65
+
console.log('\x1b[36m%s\x1b[0m','\n START of item(s) crawling.');
66
+
getItems(itemCategory,getLinksFromFile());
67
67
}).catch(function(err){
68
-
console.log('\x1b[31m%s\x1b[0m','/!\\Broken promise from getPageLinks');
69
-
console.log(err);
70
-
process.exit();
68
+
console.log('\x1b[31m%s\x1b[0m','/!\\Broken promise from getPageLinks');
69
+
if(err.statusCode=='429')console.log('\x1b[31m%s\x1b[0m','\n/!\\Error 429 detected ! You reached maximum request per hour, over pass it will provoke a ban IP from Ankama. Resume the parsing after 1h !'),process.exit();
70
+
elseif(err.code=='ETIMEDOUT')console.log('\x1b[31m%s\x1b[0m','\n /!\\ Error ETIMEDOUT detected ! Your connexion took too much time to respond.'),process.exit();
71
+
elseif(err.message=='Error: read ECONNRESET')console.log('\x1b[31m%s\x1b[0m','\n /!\\ Error ECONNRESET detected ! Connexion shutdown or reset, verify your internet connexion !'),process.exit();
72
+
elseif(err.message=='Error: unable to verify the first certificate')console.log('\x1b[33m%s\x1b[0m','/!\\However, don\'t worry: if your relaunch it, the app will resume the parsing from last item parsed ;)'),process.exit();
73
+
elseconsole.log(err),console.log('\x1b[31m%s\x1b[0m','/!\\Broken promise from getPageLinks'),process.exit();
0 commit comments