2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-15 11:59:42 +03:00

update readme (#5261)

This commit is contained in:
relbns
2022-11-22 20:39:49 +02:00
committed by GitHub
parent e05fe7c42b
commit a372b4ce4b
+3 -1
View File
@@ -763,6 +763,8 @@ Read [the interceptor tests](./test/specs/interceptors.spec.js) for seeing all t
## Handling Errors
the default behavior is to reject every response that returns with a status code that falls out of the range of 2xx and treat it as an error.
```js
axios.get('/user/12345')
.catch(function (error) {
@@ -785,7 +787,7 @@ axios.get('/user/12345')
});
```
Using the `validateStatus` config option, you can define HTTP code(s) that should throw an error.
Using the `validateStatus` config option, you can override the default condition (status >= 200 && status < 300) and define HTTP code(s) that should throw an error.
```js
axios.get('/user/12345', {