added channel send to all catches so there are no silent fails
This commit is contained in:
3
bot.js
3
bot.js
@@ -134,6 +134,7 @@ function imgurRequest(subreddit, page_max) {
|
|||||||
if(json_data) { returnText = json_data.link; }
|
if(json_data) { returnText = json_data.link; }
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Ignore the error and let the calling method handle the empty string.
|
// 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.
|
// Ignore the error and continue.
|
||||||
// continue; <-- last line in the loop... so does nothing.
|
// 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.name);
|
||||||
//message.channel.send(error.message);
|
//message.channel.send(error.message);
|
||||||
client.channels.get('357365312620068874').send(error.message);
|
client.channels.get('357365312620068874').send(error.message);
|
||||||
// If "Cannot read property 'link' of undefined" then the reddit doesn't exist.
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user