Skip to content

Commit 54627cc

Browse files
chore: update posts/en/handling_errors.md (#186)
Co-authored-by: Jay <[email protected]>
1 parent 8e2bdb2 commit 54627cc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

posts/en/handling_errors.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ next_title: 'Cancellation'
66
next_link: '/docs/cancellation'
77
---
88

9+
The general structure of axios errors is as follows:
10+
- **message** - A quick summary of the error message and the status it failed with.
11+
- **name** - This defines where the error originated from. For axios, it will always be an 'AxiosError'.
12+
- **stack** - Provides the stack trace of the error.
13+
- **config** - An axios config object with specific instance configurations defined by the user from when the request was made.
14+
- **code** - Represents an axios identified error. The table below lists out specific definitions for internal axios error.
15+
- **status** - HTTP response status code. See [here](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) for common HTTP response status code meanings.
916
```js
1017
axios.get('/user/12345')
1118
.catch(function (error) {
@@ -45,4 +52,4 @@ axios.get('/user/12345')
4552
.catch(function (error) {
4653
console.log(error.toJSON());
4754
});
48-
```
55+
```

0 commit comments

Comments
 (0)