From ab5513cf782a7faf77b5ab2864aff2dda4c763d6 Mon Sep 17 00:00:00 2001 From: 1 gal Rosemary <141131070+Tuscan-blue@users.noreply.github.com> Date: Mon, 8 Apr 2024 20:56:08 +0800 Subject: [PATCH] docs: update posts/en/handling_errors.md --- posts/en/handling_errors.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/posts/en/handling_errors.md b/posts/en/handling_errors.md index 43af6ade..48683e5b 100644 --- a/posts/en/handling_errors.md +++ b/posts/en/handling_errors.md @@ -6,6 +6,13 @@ next_title: 'Cancellation' next_link: '/docs/cancellation' --- +The general structure of axios errors is as follows: +- **message** - A quick summary of the error message and the status it failed with. +- **name** - This defines where the error originated from. For axios, it will always be an 'AxiosError'. +- **stack** - Provides the stack trace of the error. +- **config** - An axios config object with specific instance configurations defined by the user from when the request was made. +- **code** - Represents an axios identified error. The table below lists out specific definitions for internal axios error. +- **status** - HTTP response status code. See [here](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) for common HTTP response status code meanings. ```js axios.get('/user/12345') .catch(function (error) { @@ -45,4 +52,4 @@ axios.get('/user/12345') .catch(function (error) { console.log(error.toJSON()); }); -``` \ No newline at end of file +```