From a372b4ce4b8027faf1856b3a2a558ce582965864 Mon Sep 17 00:00:00 2001 From: relbns <85161279+relbns@users.noreply.github.com> Date: Tue, 22 Nov 2022 20:39:49 +0200 Subject: [PATCH] update readme (#5261) --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b171a099bc..926c31b923 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', {