javascript - How to programmatically get network errors in AngularJS -


i have following code in abcd.js:

$http({url: 'some url' , method: 'post', data: , headers: {} }).then(function(response)) { ............. }, function error(response) { .............. }) 

in case of error values of response.status = -1, response.statustext ="". no useful info. in chrome debugger console output see:

post: url/analysis.php net::err_network_io_suspended

the chrome debugger extracts real error analysis.php network packet , displays it. q1: why status , statustext dont have useful info?

q2: possible programmatically network error? in above failure example err_network_io_suspended.

q3: programmatically there other way network error when $http() fails?

q1: why status , statustext dont have useful info?

because cannot reach server, won't useful status code server.

q2: possible programmatically network error?

you can set timeout $http catch network problems manually.

q3: programmatically there other way network error when $http() fails?

take advantage of error callback of $http? (i don't know this)


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -