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

docs($http): Add explanation for error status #14459

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/ng/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only codes < -1 are normalized. -1 is returned as is (and usually, means aborted, e.g. via timeout).

* 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
Expand Down