Basically the problem is that even if I wrap the code that causes the error in try catch, the error still stops the code, here's my code.
// snip
try{
// get user using id "does-not-exist", which does not exist
// code stops when fetching user
client.users.fetch('does-not-exist').then(function (user) {
user.send('hello');
});
}catch(err){
console.error('message could not be sent');
}
Why does my code stops even if I wrap it with try catch?