title: Rejecting a promise throws "Uncaught (in promise)"
body: <p>I'm using promises to handle to handle a modal dialog: resolved when the user press the OK button, rejected when cancelled or closed.</p>
  
  <p>To resolve and dismiss the modal I use this methods:</p>
  
  <pre><code>    let modalResolve, modalReject;
      modal.promise = new Promise&lt;any&gt;((resolve, reject) =&gt; {
          modalResolve = resolve;
          modalReject = reject;
      });
      modal.close = (result) =&gt; {
          if (modal.isOpen) {
              modalResolve(result);
          }
      };
      modal.dismiss = (reason) =&gt; {
          if (modal.isOpen) {
              modalReject(reason);
          }
      };
      modal.promise.finally(() =&gt; modalElement.remove());
  </code></pre>
  
  <p>And when cancel button fires this method within the modal:</p>
  
  <pre><code>modal.dismiss('close')
  </code></pre>
  
  <p>Everything is working fine and the modal hides, but a console error is logged with this description and stack:   </p>
  
  <pre><code>Error: Uncaught (in promise): close
      at resolvePromise (zone.js:814)
      at resolvePromise (zone.js:771)
      at eval (zone.js:873)
      at ZoneDelegate.invokeTask (zone.js:421)
      at Object.onInvokeTask (core.js:4751)
      at ZoneDelegate.invokeTask (zone.js:420)
      at Zone.runTask (zone.js:188)
      at drainMicroTaskQueue (zone.js:595)
      at ZoneTask.invokeTask [as invoke] (zone.js:500)
      at invokeTask (zone.js:1540)
  </code></pre>
  
  <p>It is weird because the modal is dismissed anyway, and this error is not shown on all modals I use, just in some of them. Resolving does not produce this kind error.</p>