Browse Source

update error handling

k.niemeskern 2 years ago
parent
commit
f3ff06a204
2 changed files with 2 additions and 3 deletions
  1. 2 2
      index.js
  2. 0 1
      lib/API.js

+ 2 - 2
index.js

@@ -28,7 +28,7 @@ if (process.env.expire) info.expire = process.env.expire
 async function watchLinkedin(){
     if (info.active){
 
-        await API.getCompanyFollowers(info).then( (followersNb) => {
+        API.getCompanyFollowers(info).then( (followersNb) => {
 
             if (followersNb.firstDegreeSize) {
                 info.followers = followersNb.firstDegreeSize
@@ -38,7 +38,7 @@ async function watchLinkedin(){
             }
 
         }).catch( (err) => {
-            console.log("[DEBUG-LOG][watchLinkedin]", err);
+            console.log("[DEBUG-LOG][watchLinkedin ERROR]", err);
             info.error++
             if (info.error > 50) {
                 info.active = false

+ 0 - 1
lib/API.js

@@ -34,7 +34,6 @@ class API {
             };
 
             request.get({ url: url, headers: headers }, (err, response, body) => {
-                console.log(body);
                 if(err || body.status == 401) reject(err);
                 resolve(JSON.parse(body));
             });