Zend Framework: How to handle exceptions in Ajax requests?

Posted by understack on Stack Overflow See other posts from Stack Overflow or by understack
Published on 2010-06-01T06:46:59Z Indexed on 2010/06/01 6:53 UTC
Read the original article Hit count: 140

Normally when an exception is thrown, Error controller takes command and displays error page with regular common header and footer.

This behavior is not wanted in Ajax request. Because in case of error, whole html page is sent over. And in cases where I'm directly loading the content of http response in a div, this is even more unwanted.

Instead in case of Ajax request, I just want to receive 'the actual error' thrown by exception.

How can I do this?

I think, one dirty way could be: set a var in ajax request and process accordingly. Not a good solution.

© Stack Overflow or respective owner

Related posts about php

Related posts about AJAX