> For the complete documentation index, see [llms.txt](https://jscula.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jscula.gitbook.io/docs/ajax/nexus-http-client/handling-errors.md).

# Handling Errors

Nexus simplifies error handling by attaching a `response` object to the error, providing detailed context.

```javascript
const client = nexus.create({...});
```

```javascript
try{
  const response = await client.get('/invalid-endpoint');
  console.log(response.data) //your response data
  console.log(response) // all the http response object
}catch(error){
  console.error(error.message); // Error message
  console.error(error.response); // Full response object
}
```
