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 :|
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
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() {