Handling exceptions and authentication with AJAX and Symfony2
I needed to elegantly deal with exceptions that arose when making AJAX requests to a Symfony2 application, and after putting together a few approaches that I found on the 'net I came up with an approach that I've written up here:
http://marvelley.com/2012/12/20/symfony2-json-responses-for-xhr-errors-and-authentication-failures/
I've also put together a demo application which can be used to see my solution in action:
https://github.com/craigmarvelley/symfony2-xhr-error-handling
Written by Craig Marvelley
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ajax
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#