I tend to use a lot of jquery ajax calls to the server side in my applications.
Usually when something goes wrong on the server side ill serialize an errormessage and send as a response (JSON). Something similar to
{ "ErrorMessage" : "Something went wrong: " + ex.message }
What I would like to know is if there's any way to make errors end up in jquery ajax error
callback, rather than success
.
Is there any way to do this? Or should I stick to my old way of handling errors? It doesn't matter if you provide a PHP or ASP.NET + c# example, since im intrested in both. Thanks