title: How to reject in async/await syntax?
body: <p>How can I reject a promise that returned by an <code>async</code>/<code>await</code> function?</p>
  <p>e.g. Originally:</p>
  <pre class="lang-js prettyprint-override"><code>foo(id: string): Promise&lt;A&gt; {
    return new Promise((resolve, reject) =&gt; {
      someAsyncPromise().then((value)=&gt;resolve(200)).catch((err)=&gt;reject(400))
    });
  }
  </code></pre>
  <p>Translate into <code>async</code>/<code>await</code>:</p>
  <pre class="lang-js prettyprint-override"><code>async foo(id: string): Promise&lt;A&gt; {
    try{
      await someAsyncPromise();
      return 200;
    } catch(error) {//here goes if someAsyncPromise() rejected}
      return 400; //this will result in a resolved promise.
    });
  }
  </code></pre>
  <p>So, how could I properly reject this promise in this case?</p>