is it possible for .catch() to contain sensitive data?

i mean, is it possible to leak some private info like Bot Token if you directly share .catch() error in discord?
11 Replies
⚡AmirhN
⚡AmirhNOP3y ago
this is an example of what im getting now and it's fine:
I can't create the Category! ❌
DiscordAPIError: Missing Permissions
I can't create the Category! ❌
DiscordAPIError: Missing Permissions
and the code:
await interaction.guild.channels.create('log', {
type: 'GUILD_TEXT',
parent: category
}).catch(err => {
interaction.editReply(`I can't create the Channel! ❌\n${err}`);
...
await interaction.guild.channels.create('log', {
type: 'GUILD_TEXT',
parent: category
}).catch(err => {
interaction.editReply(`I can't create the Channel! ❌\n${err}`);
...
souji
souji3y ago
always depends on what you catch as well, you could technically throw your config
⚡AmirhN
⚡AmirhNOP3y ago
yeah it's ephemeral. well i will just use it in cases that i'm 99% sure it's a ApiError or something, like .catch() on adding roles OR creating channels. so i guess it's fine, right? and it will be always ephemeral
souji
souji3y ago
i personally prefer to discern them based on codes and having the user facing error something useful for them, not me, and log the actual error to look at, if need be
⚡AmirhN
⚡AmirhNOP3y ago
true so i guess ill just remove the ${err} and add something from myself
souji
souji3y ago
for example, here, on missing perms, it'd make sense to tell the user to enable which perms
⚡AmirhN
⚡AmirhNOP3y ago
yeah true thanks for your time :D
souji
souji3y ago
but yeah, generally, discord api errors should not be leakign credentials
⚡AmirhN
⚡AmirhNOP3y ago
thanks! ill archive it
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
souji
souji3y ago
oh boi, you did not read the issue at all, did you... locking
Want results from more Discord servers?
Add your server