If you want unified way to handle both uncaught errors and unhandled promise rejections you may have a look on uncaught library.
EDIT
<script type="text/javascript" src=".../uncaught/lib/index.js"></script><script type="text/javascript"> uncaught.start(); uncaught.addListener(function (error) { console.log('Uncaught error or rejection: ', error.message); });</script>
It listens window.unhandledrejection
in addition to window.onerror.