Skip to content

Commit f3188c1

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 2f4967f commit f3188c1

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
@@ -172,8 +172,7 @@ function $HttpProvider() {
172172
* }).
173173
* error(function(data, status, headers, config) {
174174
* // called asynchronously if an error occurs
175-
* // or server returns response with status
176-
* // code outside of the <200, 400) range
175+
* // or server returns response with an error status.
177176
* });
178177
* </pre>
179178
*
@@ -182,6 +181,10 @@ function $HttpProvider() {
182181
* an object representing the response. See the api signature and type info below for more
183182
* details.
184183
*
184+
* A response status code that falls in the [200, 300) range is considered a success status and
185+
* will result in the success callback being called. Note that if the response is a redirect,
186+
* XMLHttpRequest will transparently follow it, meaning that the error callback will not be
187+
* called for such responses.
185188
*
186189
* # Shortcut methods
187190
*

0 commit comments

Comments
 (0)