Catching errors from nested async/await functions
<p>I have a function chain in a <code>node 4.3</code> script that looks something like, callback -> promise -> async/await -> async/await -> async/await</p>

<p>like so:</p>

<pre><code>const topLevel = (resolve, reject) =&gt; {
    const foo = doThing(data)
    .then(results =&gt; {
        resolve(results)
    })
    .catch(err =&gt; {
        reject(err)
    })
}

async function doThing(data) {
    const thing = await doAnotherThing(data)
    return thing
}

async function doAnotherThing(data) {
    const thingDone = await etcFunction(data)
    return thingDone
}
</code></pre>

<p>(The reason it isn't <code>async/await</code> all the way through is that the top level function is a task queue library, and ostensibly can't be run <code>async/await</code> style)</p>

<p>If <code>etcFunction()</code> throws, does the <code>error</code> bubble up all the way to the top-level <code>Promise</code>?  </p>

<p>If not, how can I bubble-up <code>errors</code>? Do I need to wrap each <code>await</code> in a <code>try/catch</code> and <code>throw</code> from there, like so?</p>

<pre><code>async function doAnotherThing(data) {
   try {
     await etcFunction(data)
   } catch(err) {
     throw err  
   }
}
</code></pre>