forked from Galactic/modmail
error handling for failed channel creation
This commit is contained in:
parent
11b852a6f2
commit
f8d20ac2ee
@ -124,7 +124,16 @@ class ChannelHandler {
|
||||
if (!channel) { // Create and populate channel
|
||||
channel = await guild.channels.create(`${user.username}_${user.discriminator}`, {
|
||||
parent: this.newMail.id
|
||||
}).catch(err => {
|
||||
this.client.logger.warn(`Failed to create channel for ${user.tag}, trying again.\n${err.stack || err}`);
|
||||
});
|
||||
if (!channel) channel = await guild.channels.create(`${user.id}`, {
|
||||
parent: this.newMail.id
|
||||
}).catch(err => {
|
||||
// this.client.logger.error(`Failed on second create:\n${err.stack || err}`);
|
||||
return { err };
|
||||
});
|
||||
if (!channel.err) return reject(channel.err);
|
||||
|
||||
// Start with user info embed
|
||||
const embed = {
|
||||
|
@ -156,7 +156,7 @@ class Modmail {
|
||||
|
||||
const channel = await this.channels.load(member, pastModmail)
|
||||
.catch((err) => {
|
||||
this.client.logger.error(`Error during channel handling:\n${err.stack}`);
|
||||
this.client.logger.error(`Error during channel handling:\n${err.stack || err}`);
|
||||
return { error: true };
|
||||
});
|
||||
if (channel.error) return author.send(`Internal error, this has been logged.`);
|
||||
|
Loading…
Reference in New Issue
Block a user