Is there possible way to handle error that will return right back after error is triggered?
if(command === 'test') {
message.author.send('Dm Test').catch(error => {
message.reply('I failed to send you a private message!')
return;
})
//some code below, should not trigger after sending message error.
The problem is that .catch
will respond as last, how to handle this error and immediately return instead of running also code below? I tried to use try {
but that didn't work.
message.author.send('