Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit f9a4290

Browse files
committed
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](#11945)
1 parent 997f482 commit f9a4290

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/ng/http.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,9 +451,11 @@ function $HttpProvider() {
451451
* - **statusText** – `{string}` – HTTP status text of the response.
452452
*
453453
* A response status code between 200 and 299 is considered a success status and
454-
* will result in the success callback being called. Note that if the response is a redirect,
455-
* XMLHttpRequest will transparently follow it, meaning that the error callback will not be
456-
* called for such responses.
454+
* will result in the success callback being called. Response status code other than
455+
* the mentioned ones is considered as error status. The error callback is called in such case.
456+
* Also, any negative status code is normalized to zero. Other codes are returned as such.
457+
* Note that if the response is a redirect, XMLHttpRequest will transparently follow it, meaning
458+
* that the error callback will not be called for such responses.
457459
*
458460
*
459461
* ## Shortcut methods

0 commit comments

Comments
 (0)