[fw-general] How to display errors when an ajax request fail?

2009-10-28 Thread Juan Felipe Alvarez Saldarriaga
Hey. I'm using the default ErrorController from Zend_Tool, so, when an error is thrown setHttpResponseCode sets an error 500, how can I catch the exception message on javascript? how can I set the exception message into the response object? there's not setMessage method in Zend_Http_Response :|

Re: [fw-general] How to display errors when an ajax request fail?

2009-10-28 Thread drm
Juan Felipe Alvarez Saldarriaga wrote: I'm using the default ErrorController from Zend_Tool, so, when an error is thrown setHttpResponseCode sets an error 500, how can I catch the exception message on javascript? how can I set the exception message into the response object? there's not

Re: [fw-general] How to display errors when an ajax request fail?

2009-10-28 Thread Саша Стаменковић
If you send header HTTP code 500 from your controller $this-getResponse()-setHttpResponseCode(500); you can catch it in your javascript with $.ajax({ type: 'POST', url: '/c/a', data: $('#form').serialize(), dataType: 'html', success: function(response) { // success code }, error: function() {