title: In Angular, how to handle promise reject when using async/await
body: <p>In Angular, if I use promise, the code would be </p>
  
  <pre><code>let promise = this.$resource('www.example.com.au/request.json').get().$promise
  promise.then(data =&gt; {
      //promise solved
  }, () =&gt; {
     //promise rejected
  })
  </code></pre>
  
  <p>when it comes to async/await
  the code becomes</p>
  
  <pre><code>async getData() {
      let data = await this.$resource('www.example.com.au/request.json').get().$promise
      this.localData = {...data}
  }
  </code></pre>
  
  <p>but this is only for promise solved. if it is promise rejected, what should I do? thanks</p>