better error handling
This commit is contained in:
14 files changed
+160
-157
No files matched your search
+6
-6
@@ -84,9 +84,9 @@ module.exports = {
|
||||
newInventory.save()
|
||||
.catch(err => {
|
||||
if (err) {
|
||||
client.log(err);
|
||||
client.error(err);
|
||||
const embed = new EmbedBuilder()
|
||||
.setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
|
||||
.setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
|
||||
.setColor(client.config.Colors.Red)
|
||||
|
||||
return interaction.send({ embeds: [embed] });
|
||||
@@ -97,9 +97,9 @@ module.exports = {
|
||||
if (!client.exists(inventory.guilds[GuildDB.serverID])) {
|
||||
const success = addInventory(inventory.guilds, GuildDB.serverID, interaction.member.user.id, client);
|
||||
if (!success) {
|
||||
client.log(err);
|
||||
client.error(err);
|
||||
const embed = new EmbedBuilder()
|
||||
.setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
|
||||
.setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
|
||||
.setColor(client.config.Colors.Red)
|
||||
|
||||
return interaction.send({ embeds: [embed] });
|
||||
@@ -155,9 +155,9 @@ module.exports = {
|
||||
|
||||
client.dbo.collection("inventories").updateOne(query, update, function (err, res) {
|
||||
if (err) {
|
||||
client.log(err);
|
||||
client.error(err);
|
||||
const embed = new EmbedBuilder()
|
||||
.setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
|
||||
.setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
|
||||
.setColor(client.config.Colors.Red)
|
||||
|
||||
return interaction.send({ embeds: [embed] });
|
||||
|
||||
Reference in new issue
Block a user