Try this:
CODE:
<html><body><script>((Promise) => { const originalThen = Promise.prototype.then; const originalCatch = Promise.prototype.catch; Promise.prototype.then = function (...args) { console.log("Called .then on %o with arguments: %o", this, args); return originalThen.apply(this, args); }; Promise.prototype.catch = function (...args) { console.error("Called .catch on %o with arguments: %o", this, args); return originalCatch.apply(this, args); };})(Promise);document.body.addEventListener('click', async function () { async function usingPromiseReject() { return Promise.reject('Using Promise.reject'); }; await usingPromiseReject().catch(err => console.log('Caught: ' + err));});</script>click</body></html>