title: React js Error Boundary doesn't work with Promise Catch
body: <p>We have a Error Boundary component : </p>
  
  <pre><code>import React from 'react';
  class ErrorBoundary extends React.Component {
    constructor(props) {
      super(props);
      this.state = { hasError: false, errorMessage:''};
    }
  
    componentDidCatch(error, info) {
      // Display fallback UI
      this.setState({ hasError: true, errorMessage: error });
      // You can also log the error to an error reporting service
    }
  
    render() {
      if (this.state.hasError) {
        debugger
        // You can render any custom fallback UI  
        return &lt;h1&gt;{this.state.errorMessage.toString()}&lt;/h1&gt;;
      }
      return this.props.children;
    }
  }
  
  export default ErrorBoundary;
  </code></pre>
  
  <p>And We are using it like this :</p>
  
  <pre><code>ReactDOM.render(
      &lt;Provider store={store}&gt;
          &lt;Router&gt;
              &lt;CookiesProvider&gt;
                  &lt;ErrorBoundary&gt;
                      &lt;NetworkMgmt /&gt;
                  &lt;/ErrorBoundary&gt;
              &lt;/CookiesProvider&gt;
          &lt;/Router&gt;
      &lt;/Provider&gt;,
       document.getElementById('root')
  );
  </code></pre>
  
  <p>After that i tries to throw the error by using below code snippet, but that doesn't call Error Boundary componentDidCatch(), instead it throws the unhandled exception.</p>
  
  <pre><code>    dataService.getNetworkSummary().then(function (result) {
          debugger
          self.networks = result;
          self.setState({
              items: result.slice(0, 20),
              total: result.length,
              skip: 0,
              pageSize: 20,
              pageable: {
                  buttonCount: 5,
                  info: true,
                  type: 'numeric',
                  pageSizes: [20, 40, 60, 80, 100],
                  previousNext: true
              },
              sortable:{
                  allowUnsort: true,
                  mode: 'single',
                  sortDir:'Asc'
              }
  
          })
      }).catch(err =&gt;
           {
               throw new Error("This is my error");
           });
  </code></pre>
  
  <p>Is there any way we can do it in correct manner.</p>