Skip to content

Commit

Permalink
Add error toJSON example (#2466)
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuf authored and felipewmartins committed Oct 16, 2019
1 parent 19969b4 commit ccca5e0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -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*.
Expand Down

0 comments on commit ccca5e0

Please sign in to comment.