Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update posts/en/handling_errors.md #186

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion posts/en/handling_errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -45,4 +52,4 @@ axios.get('/user/12345')
.catch(function (error) {
console.log(error.toJSON());
});
```
```