title: Uncaught (in promise) Error
body: <p>This is obviously a SSCCE. I have the following (jsFiddle <a href="https://jsfiddle.net/6jp756fk/" rel="noreferrer">here</a>):</p>
  
  <pre><code>&lt;html&gt;
    &lt;body&gt;
      &lt;input id='file-dlg' type='file'/&gt;
      &lt;br/&gt;
      &lt;button id='submit' type='button'&gt;submit&lt;/button&gt;
      &lt;script&gt;
       document.getElementById('file-dlg').addEventListener('change', storeAPromise);
       var p; 
       function storeAPromise() {
         p = new Promise(function executor(resolve, reject) {
           try {
             throw new Error('snafu');
           } catch(e) {
             reject(e);
           }
         });
       };
       document.getElementById('submit').onclick = function() {
         p.then(function() {}, function reject(e) {
           console.error('some problem happenned', e);
         });
       };
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When the user is using the file dialog to select a file, I expect nothing at all to be printed on the console as the <code>Error</code> is caught and the promise's <code>reject</code> function is called. In contrast, I am expecting the error to appear on the console with the description "some error happened" only when I click the "submit" button.</p>
  
  <p>Yet, this is not what I observe. As soon as the user selects a file with the dialog I see on the console:</p>
  
  <pre><code>Uncaught (in promise) Error: snafu(…)
  </code></pre>
  
  <p>When the user presses the "submit" button I do see the expected log line "some problem happened" but I don't understand why I also see the earlier "Uncaught (in promise)" log line when the user selects a file with the file dialog. I also don't see why the error is described as "Uncaught" given that I catch (unconditionally) all exceptions and simple invoke the <code>reject</code> function.</p>