PDA

View Full Version : [CLOSED] Handling only Ajax Communication Errors



sbg
Jul 13, 2012, 9:46 AM
Hello,

is there any way to handle only Ajax communication errors?
We would like to show the standard exception message if an unhanded exception occurs on server-side, but we would like to show a custom message or to do some other action only on ajax communication error. We tried something like:



<AjaxRequestException Handler="alert('Server busy, please try later')"></AjaxRequestException>


But the message is show for every kind of error. How to filter only communication errors?

Thank you in advance
Regards

Daniil
Jul 13, 2012, 10:30 AM
Hi,

The "response" argument is passed to an AjaxRequestException listener. You could analyze

response.status
and

response.statusText
to make a judgement to show an error message or not.