Skip to content

Commit

Permalink
Document StatusCodeError in more detail.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstos committed Aug 30, 2021
1 parent 1294929 commit 6c5ece2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ use OAuth, they are not available on the `client` object.

## Error Handling

With the exception of the OAuth calls, errors will returned that are
Except for the OAuth calls, errors will returned that are
`instanceof` `StatusCodeError` when the HTTP status code is not 2xx. In the
Promise-based API, the promise will be rejected. An error of type
`RequestError` will be returned if the request fails for technical reasons.
Expand All @@ -357,6 +357,14 @@ Example error checking:
}
```
The `StatusCodeError` object includes extra properties to help with debugging:
- `name` is always `StatusCodeError`
- `statusCode` contains the HTTP status code
- `message` Contains the body of the response.
- `options` Contains the `option` used in the request
- `response` Contains the response object
## Development
This package includes a full test suite runnable via `yarn test`.
Expand Down

0 comments on commit 6c5ece2

Please sign in to comment.