Skip to content

Commit 74db36e

Browse files
provegardpkozlowski-opensource
authored andcommitted
docs($http): clarify documentation on error status codes
Modify the documentation for $http to correspond to what Angular considers a success status code. Closes angular#1693
1 parent 8d42ce8 commit 74db36e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ng/http.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,7 @@ function $HttpProvider() {
208208
* }).
209209
* error(function(data, status, headers, config) {
210210
* // called asynchronously if an error occurs
211-
* // or server returns response with status
212-
* // code outside of the <200, 400) range
211+
* // or server returns response with an error status.
213212
* });
214213
* </pre>
215214
*
@@ -218,6 +217,10 @@ function $HttpProvider() {
218217
* an object representing the response. See the api signature and type info below for more
219218
* details.
220219
*
220+
* A response status code that falls in the [200, 300) range is considered a success status and
221+
* will result in the success callback being called. Note that if the response is a redirect,
222+
* XMLHttpRequest will transparently follow it, meaning that the error callback will not be
223+
* called for such responses.
221224
*
222225
* # Shortcut methods
223226
*

0 commit comments

Comments
 (0)