From 272f1c881fa4c76ba10ef2169ab22b49d6f71017 Mon Sep 17 00:00:00 2001 From: Abhishek Garg Date: Mon, 18 Apr 2016 19:20:14 +0530 Subject: [PATCH] docs($http): Add explanation for error status Add explanation for error status codes in $http call and line about normalization to zero in case of negative status code. This alleviates confusion about status codes for which error callback would be called and final values to be expected from an erroneous call. Fixes #11945 --- src/ng/http.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ng/http.js b/src/ng/http.js index aa8e229e7da0..ec5862800b78 100644 --- a/src/ng/http.js +++ b/src/ng/http.js @@ -451,9 +451,11 @@ function $HttpProvider() { * - **statusText** – `{string}` – HTTP status text of the response. * * A response status code between 200 and 299 is considered a success status and - * will result in the success callback being called. Note that if the response is a redirect, - * XMLHttpRequest will transparently follow it, meaning that the error callback will not be - * called for such responses. + * will result in the success callback being called. Response status code other than + * the mentioned ones is considered as error status. The error callback is called in such case. + * Also, any negative status code is normalized to zero. Other codes are returned as such. + * Note that if the response is a redirect, XMLHttpRequest will transparently follow it, meaning + * that the error callback will not be called for such responses. * * * ## Shortcut methods