better error handling
This commit is contained in:
14 files changed
+160
-157
No files matched your search
+6
-6
@@ -78,9 +78,9 @@ module.exports = {
|
||||
newBank.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] });
|
||||
@@ -92,9 +92,9 @@ module.exports = {
|
||||
if (!client.exists(banking.guilds[GuildDB.serverID])) {
|
||||
const success = addBank(banking.guilds, GuildDB.serverID, targetUserID, client, GuildDB.startingBalance);
|
||||
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] });
|
||||
@@ -105,9 +105,9 @@ module.exports = {
|
||||
|
||||
client.dbo.collection("banks").updateOne({"account.userID":targetUserID},{$set:{[`banking.guilds.${GuildDB.serverID}.account.balance`]:newTargetBalance}}, 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