title: Can I catch an error from async without using await?
body: <p>Can errors from a non-awaited async call be caught, sent to an original encapsulating try/catch, or raise an uncaught exception?</p>
  
  <p>Here's an example of what I mean:</p>
  
  <pre><code>async function fn1() {
      console.log('executing fn1');
  }
  
  async function fn2() {
      console.log('executing fn2');
      throw new Error('from fn2');
  }
  
  async function test() {
      try {
          await fn1();
          fn2();
      }
      catch(e) {
          console.log('caught error inside test:', e);
      }
  }
  
  test();
  </code></pre>
  
  <p>In this scenario, the error thrown from <code>fn2</code> will be swallowed silently, and definitely not caught by the original <code>try/catch</code>. I believe this is expected behavior, since <code>fn2</code> is most likely being shoved off to the event loop to finish at some point in the future, and <code>test</code> doesn't care when it finishes (which is intentional).</p>
  
  <p>Is there any way to ensure that errors are not accidentally swallowed by a structure like this, short of putting a <code>try/catch</code> internal to <code>fn2</code> and doing something like emitting an error? I would even settle for an uncaught error without knowing how to catch it, I think -- I don't expect thrown errors to be typical program flow with what I am writing, but swallowing errors makes it relatively annoying to debug.</p>
  
  <p>Side note, I'm using Babel to transpile the code using the babel-runtime transform, and executing it with node.</p>