|
@@ -29,7 +29,9 @@ async function watchLinkedin(){
|
|
|
if (info.active){
|
|
|
|
|
|
try {
|
|
|
- API.getCompanyFollowers(info).then( (followersNb) => {
|
|
|
+ const getFollowers = API.getCompanyFollowers(info)
|
|
|
+
|
|
|
+ getFollowers.then( (followersNb) => {
|
|
|
|
|
|
if (followersNb.firstDegreeSize) {
|
|
|
info.followers = followersNb.firstDegreeSize
|
|
@@ -37,9 +39,8 @@ async function watchLinkedin(){
|
|
|
// cleanUp error
|
|
|
info.error = 0
|
|
|
}
|
|
|
- }).catch( (err)=> {
|
|
|
- return new Error(err)
|
|
|
- })
|
|
|
+ }).catch( err => new Error(err));
|
|
|
+
|
|
|
} catch (error) {
|
|
|
console.log("[DEBUG-LOG][watchLinkedin ERROR]", err);
|
|
|
info.error++
|