Greetings Overflowers,
My angularjs http.post throws an exception when my php server returns with HTTP error status 500 (Internal Server Error) although I have registered my error function to handle it. How can I stop these exceptions from being thrown?
Kind regards
EDIT: I am faking the error from my php server to see how the client behaive using this command:
header('HTTP/1.1 500 Internal Server Error');
On the client I am using (URL in here is not real):
http.post('query.php', {query: 'err'})
.success(function (data) {
console.log(data);
})
.error(function (err, status) {
console.log(status, err);
});
However registered an error function, I am still getting a thrown exception from angularjs saying something like:
POST status 500 (Internal Server Error)
Although, the web app continues to run as expected so I thought this might be normal? Specially that in angularjs.org site under HTTP service example when you change the url of the http get to something invalid you also get an exception with status 400 even with the registered error function. So am I missing something on how to stop this exception from being thrown (I see it in Chrome console)?