Catch every API

This commit is contained in:
Daniel Odendahl Jr
2017-08-27 22:04:58 +00:00
parent 75422711c3
commit eed39c5ec1
63 changed files with 785 additions and 631 deletions
+2 -2
View File
@@ -53,8 +53,8 @@ module.exports = class GitHubCommand extends Command {
moment(body.updated_at).format('MMMM Do YYYY'), true);
return msg.embed(embed);
} catch (err) {
if (err.status === 404) return msg.say('Could not find the repository.');
throw err;
if (err.status === 404) return msg.say('Could not find any results.');
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};