mirror of
https://github.com/tenrok/axios.git
synced 2026-06-05 16:42:32 +03:00
Add error toJSON example (#2466)
This commit is contained in:
committed by
Felipe Martins
parent
19969b4fbd
commit
ccca5e0e21
@@ -565,6 +565,15 @@ axios.get('/user/12345', {
|
||||
})
|
||||
```
|
||||
|
||||
Using `toJSON` you get an object with more information about the HTTP error.
|
||||
|
||||
```js
|
||||
axios.get('/user/12345')
|
||||
.catch(function (error) {
|
||||
console.log(error.toJSON());
|
||||
});
|
||||
```
|
||||
|
||||
## Cancellation
|
||||
|
||||
You can cancel a request using a *cancel token*.
|
||||
|
||||
Reference in New Issue
Block a user