Short Version: Is there a/what is the suggested way to return error details to the client when an exception is thrown in an AJAX-Enabled WCF Service (aside
The only way I am able to get exception detail back is with
I tried the suggested method with extending HttpWebBehavior but when it is used with enableWebScript like the following:
The WCF call will return status code 202 without anything information. If the configuration turns into
You will get the nicely formatted message back but you lose all the json formatting functionality as well as request parameter parsing from enableWebScript, which completely defeats the purpose of using enableWebScript
I have attempted FaultContract as well but it appears to only work for Service References and not AJAX calls from JQuery.
It would be nice to be able to override WebScriptEnablingBehavior or the service itself to provide custom error handling.