Skip to content

Commit 6c5ece2

Browse files
committed
Document StatusCodeError in more detail.
1 parent 1294929 commit 6c5ece2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ use OAuth, they are not available on the `client` object.
338338

339339
## Error Handling
340340

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

0 commit comments

Comments
 (0)