Fix Error Messages

This commit is contained in:
Daniel Odendahl Jr
2017-05-18 02:13:31 +00:00
parent 7f21d5d529
commit f799cfdb68
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -37,6 +37,7 @@ module.exports = class GelbooruCommand extends Command {
limit: 1
});
const { posts } = await xml(text);
if (!posts) throw new Error('No Results.');
return msg.say(`Result for ${query}:`, { files: [`https:${posts.post[0].$.file_url}`] })
.catch(err => msg.say(`${err.name}: ${err.message}`));
} catch (err) {
+1
View File
@@ -37,6 +37,7 @@ module.exports = class Rule34Command extends Command {
limit: 1
});
const { posts } = await xml(text);
if (!posts) throw new Error('No Results.');
return msg.say(`Result for ${query}:`, { files: [`https:${posts.post[0].$.file_url}`] })
.catch(err => msg.say(`${err.name}: ${err.message}`));
} catch (err) {