NodeJS/Express Service down error handling <p>I have my <code>client</code> which is developed in <code>angular</code> and i am trying to hit my <code>api service[rest-ful]</code>. </p> <p>If my service/server is down, how can i notify my client saying its down?</p> <pre><code>POST http://localhost:3000/login net::ERR_CONNECTION_REFUSED </code></pre> <p>In my console all i am getting is this error message, </p> <pre><code>api.login(username, password).success(function(response) { }).error(function(response, error){ //i am not getting any error message here. }); </code></pre> <p>The login method is just a <code>$http</code> call</p> <pre><code>login: function (username, password) { return $http.post('http://localhost:8080/login', { username: username, password: password }); } </code></pre>