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})
times out, I want a specific message to be sent, but what if it's another error instead?
Was this page helpful?