🥅 Error handling

This commit is contained in:
Elis Odenhage 2022-03-06 19:38:33 +01:00 committed by Axel Olausson Holtenäs
parent 8e47072fca
commit 0c4cb97c2a
No known key found for this signature in database
GPG key ID: E3AE7E194AE017ED
5 changed files with 12 additions and 12 deletions

View file

@ -84,8 +84,8 @@ module.exports = async (interaction) => {
await dmUser.send({ embeds: [dmEmbed] });
await logger.debug(`Gift sent from: ${interaction.user.username} to: ${user.username}`);
return await interaction.editReply({ embeds: [interactionEmbed], ephemeral: true });
} catch {
await logger.error();
} catch (e) {
await logger.error(e);
}
return true;
};

View file

@ -55,8 +55,8 @@ module.exports = async (interaction) => {
} to ${user.username}`,
);
return await interaction.editReply({ embeds: [embed], ephemeral: true });
} catch {
await logger.error();
} catch (e) {
await logger.error(e);
}
return true;
};

View file

@ -104,8 +104,8 @@ module.exports = async (interaction) => {
await dmUser.send({ embeds: [dmEmbed] });
await interaction.editReply({ embeds: [interactionEmbed], ephemeral: true });
})
.catch(async (err) => {
await logger.error(err);
.catch(async (e) => {
await logger.error(e);
const embed = {
title: 'Redeem',
description: 'Something went wrong.',
@ -115,8 +115,8 @@ module.exports = async (interaction) => {
};
return interaction.editReply({ embeds: [embed], ephemeral: true });
});
} catch {
await logger.error();
} catch (e) {
await logger.error(e);
}
return true;
};

View file

@ -45,7 +45,7 @@ module.exports = async (interaction) => {
footer: { iconURL: config.footer.icon, text: config.footer.text },
};
return interaction.editReply({ embeds: [embed], ephemeral: true });
} catch {
logger.error();
} catch (e) {
logger.error(e);
}
};

View file

@ -86,8 +86,8 @@ module.exports = async (interaction) => {
await logger.debug(`Gift sent from: ${interaction.user.username} to: ${to.username}`);
return await interaction.editReply({ embeds: [embed], ephemeral: true });
} catch {
logger.error();
} catch (e) {
logger.error(e);
}
return true;
};