From 479c973d7190e8d4288c0cabbb0372ed53b90417 Mon Sep 17 00:00:00 2001 From: relbns Date: Sat, 12 Nov 2022 23:40:09 +0200 Subject: [PATCH] update readme --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a3fb3ed57a..d9fef3c33d 100644 --- a/README.md +++ b/README.md @@ -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', {