title: How to properly catch errors in SweetAlert
body: <p>I have the following <code>swal</code> code and it works fine if the returned status for the HTTP call is '200'. But if I get a '403' unauthorized error the swal loader keeps spinning and the message never goes away, like shown below. I'm not sure if I'm not handling the error correctly. </p>
  
  <p><strong>Can you help?</strong></p>
  
  <p><a href="https://i.stack.imgur.com/Ylq8w.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ylq8w.png" alt="enter image description here"></a></p>
  
  <pre><code>let that = this;
  swal({
    title: 'Are you sure?',
    text: 'You won\'t be able to revert this!',
    type: 'warning',
    showCancelButton: true,
    confirmButtonText: 'Yes, delete it!',
    confirmButtonColor: '#d33',
    cancelButtonText: 'No, keep it',
    showLoaderOnConfirm: true,
    preConfirm: function (email) {
      return new Promise(function (resolve, reject) {
  
        that.http.get(url, {"headers": headers})
          .map(res =&gt; res)
          .subscribe(data =&gt; {
            console.log(data);
            if (data.status === 200) {
              resolve();
            } else {
              reject(data.status);
            }
        })          
      })
    },
    allowOutsideClick: false
  }).then(function() {
    swal(
      'Deleted!',
      'The user has been deleted.',
      'success'
    )
  }, function(dismiss) {
    if (dismiss === 'cancel') {
      swal(
        'Cancelled',
        'Nothing has been deleted!',
        'error'
      )
    }
  }).catch((error) =&gt; {
    console.log('error_does_not_reach_here', error);
  })
  </code></pre>