title: Can you "plug in" to unhandled Promise rejections in Chrome?
body: <p>A while back, v8 gained the <a href="https://code.google.com/p/v8/issues/detail?id=3093" rel="noreferrer">capability to detect Promises that are rejected but have no handlers attached</a> (<a href="https://chromium.googlesource.com/v8/v8.git/+/e68e62c8917405e33155965303bb263fae68fcb0" rel="noreferrer">commit</a>). This landed in Chrome as a nice console error, especially useful for when you've made a typo or forget to attach a handler:</p>
  
  <p><a href="https://i.stack.imgur.com/W7TWo.png" rel="noreferrer"><img src="https://i.stack.imgur.com/W7TWo.png" alt="Example of Chrome reporting a rejected promise with handlers"></a></p>
  
  <p>I would like to add a handler to take some action (e.g., reporting to an error reporting service) when this happens, similar to the uncaught exception pattern:</p>
  
  <pre><code>window.addEventListener("error", handler);
  </code></pre>
  
  <p>Alternatively, I'm looking for any mechanism that I can use to <em>automatically</em> invoke some sort of callback when a promise is rejected but not handled on that tick.</p>