How can I catch specific errors, or what is the best way to handle error catching?

I'm sorry if this is a more common question, but I want to know how I can catch specific discord.js errors. For example, when
prompt.awaitMessageComponent({time: 15_000})
prompt.awaitMessageComponent({time: 15_000})
times out, I want a specific message to be sent, but what if it's another error instead?
2 Replies
d.js toolkit
d.js toolkit8mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Swyftey
SwyfteyOP8mo ago
Is there a documentation page for "ErrorCodes"? just curious got it, nevermind but it's just names
Want results from more Discord servers?
Add your server