refactor/explicitly label mongo error origin
This commit is contained in:
3 files changed
+4
-4
No files matched your search
+1
-1
@@ -10,7 +10,7 @@ module.exports = {
|
||||
guild.Nitrado = undefined;
|
||||
if (client.databaseConnected) {
|
||||
client.dbo.collection("guilds").insertOne(guild, (err, res) => {
|
||||
if (err) throw err;
|
||||
if (err) client.error(`GetGuild Insert Error: ${err}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -32,8 +32,8 @@ module.exports = {
|
||||
{ upsert: true }, // Create player stat document if it does not exist
|
||||
(err, _) => {
|
||||
if (err) {
|
||||
if (interaction == null) return client.error(err);
|
||||
else return client.sendInternalError(interaction, err);
|
||||
if (interaction == null) return client.error(`UpdatePlayer Error: ${err}`);
|
||||
else return client.sendInternalError(interaction, `UpdatePlayer Error: ${err}`);
|
||||
} else resolve();
|
||||
}
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user