message: Add window.onunhandledrejection to log and report unhandled errors in promises. Append unhandled errors to window.windowErrors if it exists (created by gui tests).
diff: @@ -186,14 +186,6 @@ store.dispatch(getCRDs);
  analyticsSvc.push({tier: 'tectonic'});
  -render((
  - <Provider store={store}>
  - <Router history={history} basename={window.SERVER_FLAGS.basePath}>
  - <Route path="/" component={App} />
  - </Router>
  - </Provider>
  -), document.getElementById('app'));
  -
  window.onerror = function (message, source, lineno, colno, optError={}) {
  try {
  const e = `${message} ${source} ${lineno} ${colno}`;
  @@ -206,4 +198,28 @@ window.onerror = function (message, source, lineno, colno, optError={}) {
  // ignore
  }
  }
  + window.windowErrors && window.windowErrors.push([message, source, lineno, colno, optError]);
  };
  +
  +window.onunhandledrejection = function (e) {
  + try {
  + analyticsSvc.error(e, null);
  + } catch (err) {
  + try {
  + // eslint-disable-next-line no-console
  + console.error(err);
  + } catch (ignored) {
  + // ignore
  + }
  + }
  + const {promise, reason} = event;
  + window.windowErrors && window.windowErrors.push([reason, promise]);
  +};
  +
  +render((
  + <Provider store={store}>
  + <Router history={history} basename={window.SERVER_FLAGS.basePath}>
  + <Route path="/" component={App} />
  + </Router>
  + </Provider>
  +), document.getElementById('app'));
  