added channel send to all catches so there are no silent fails

This commit is contained in:
Dalton
2018-12-07 17:37:15 -08:00
parent 87867d3463
commit dd4d58c64f

3
bot.js
View File

@@ -134,6 +134,7 @@ function imgurRequest(subreddit, page_max) {
if(json_data) { returnText = json_data.link; }
} catch (error) {
// Ignore the error and let the calling method handle the empty string.
client.channels.get('357365312620068874').send(error.message);
}
}
}
@@ -170,6 +171,7 @@ function subredditRequest(subreddit) {
{
// Ignore the error and continue.
// continue; <-- last line in the loop... so does nothing.
client.channels.get('357365312620068874').send(error.message);
}
}
}
@@ -527,7 +529,6 @@ client.on('message', message => {
//message.channel.send(error.name);
//message.channel.send(error.message);
client.channels.get('357365312620068874').send(error.message);
// If "Cannot read property 'link' of undefined" then the reddit doesn't exist.
}
break;