core.js icon indicating copy to clipboard operation
core.js copied to clipboard

[DOCS]: Error response schema

Open markcellus opened this issue 2 years ago • 3 comments

Describe the need

I realize the package is just likely returning what comes from the official REST API, but can the schema for a response error be documented? I'm trying to ensure my code knows how to handle the different error responses.

I'm able to deduce that each error response has a status property, but that's all that the Github REST API seems to indicate. I'm sure there are other properties besides status because I'm seeing other things like code, message, headers, etc. Are these documented somewhere? If so, can the README be updated to point to it? If not, it would be great if it can be added.

Thanks in advance.

SDK Version

No response

API Version

No response

Relevant log output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

markcellus avatar Jan 18 '23 14:01 markcellus

Errors from requests are implemented in @octokit/request-error The documentation you want is probably there already

wolfy1339 avatar Jan 18 '23 21:01 wolfy1339

Thanks this is helpful. Unfortunately its not clear that one would need to navigate to another package to learn about errors raised in this package, without digging into the codebase.

Is it possible to just add a sentence on the README that links to that? I'd be willing to open a PR for this if that would help.

markcellus avatar Jan 18 '23 22:01 markcellus

Of course, PRs are welcome!

wolfy1339 avatar Jan 18 '23 22:01 wolfy1339