When working on my project in VueJs JavaScript, I want to be able to see console messages if any of my Promises are not fulfilled and do not have a catch block.
I attempted using the following code:
Promise.reject("error!");
window.addEventListener('unhandledrejection', event => {
console.log('i am error')
});
Unfortunately, this approach did not work. Is there another method I can try? Or how can I resolve this issue?