const throwError = () => { throw "I'm an error!" } try { Promise .resolve() .then(throwError) } catch (error) { console .log(error) } // Uncaught (in promise) I'm an error!