Skip to content

Commit

Permalink
update readme (#5261)
Browse files Browse the repository at this point in the history
  • Loading branch information
relbns committed Nov 22, 2022
1 parent e05fe7c commit a372b4c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -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) {
Expand All @@ -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', {
Expand Down

0 comments on commit a372b4c

Please sign in to comment.