title: JQuery can't catch exception in the Restful web serverice.
body: <p>I am using JQuery get ajax call, it will not catch the exception in the callback function, In the java restful code, I force it to throw WebApplicationException exception, but Ajax call can't catch it, but it will show up in the Chrome console. </p>
  
  <p>How to catch it in the ajax callback method ? thanks.</p>
  
  <pre><code>@GET
      @Path("getForm")
      @Produces(MediaType.APPLICATION_JSON)
      public String getForm() throws Exception {
      .....
          if (1==1) {
              System.out.println("---exeption ---");
              throw new WebApplicationException(Response.Status.UNAUTHORIZED);
          }
         ....
      }
  </code></pre>
  
  <p>Ajax call</p>
  
  <pre><code>$.get('myurl', function(data, status) {
                  alert(status); // not executed at all
                  if (status === 'success') {
                      alert("success");
                  }
                  else {
                      alert("load failed");
                  }
              });
  </code></pre>
  
  <p>In the Chrome console, I can see the error message: 401 (Unauthorized) . </p>