ASP.NET Web API Exception Throwing
I am trying to throw an exception from my web API controller. The problem is my JavaScript code is not returning any data.
throw new HttpResponseException(HttpStatusCode.NoContent);
In my jQuery ajax function I am getting nothing. I am getting undefined back from the ajax call. So basically what is the correct way to handle errors from the server?
+3
source to share