When a promise throws an error and we have to catch it just so it won't show "Uncaught dummy error", I found those similar approaches:
Using Promise.then:
const promise1 = new Promise((resolve, reject) => {throw 'dummy error'}).then(null, error => console.error(error));
Using Promise.catch:
const promise2 = new Promise((resolve, reject) => {throw 'dummy error'}).catch(error => console.error(error));
What should be the best practice to follow in this scenario?
When tested, both approaches are returning 'dummy error' in console.