Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Well-defined API errors #361

Closed
ejoebstl opened this issue Sep 5, 2017 · 3 comments
Closed

Well-defined API errors #361

ejoebstl opened this issue Sep 5, 2017 · 3 comments

Comments

@ejoebstl
Copy link
Contributor

ejoebstl commented Sep 5, 2017

It would be great to have a schema for API errors, or at least some pre-defined codes that are easily machine-readable.

Detecting which error happened can ease robust programming a lot.

For example, I might want to explicitly handle accessing a node that does not exist, retry on a connection error, and fail hard on a syntax error in the query.

@kbrandwijk
Copy link
Contributor

kbrandwijk commented Sep 5, 2017

@schickling
Copy link
Member

Thanks a lot for bringing this up @ejoebstl. Typed errors is definitely something we'd love to support at some point in the future as soon as this becomes officially part of the GraphQL spec. Check the following issue to track the progress in the GraphQL spec: graphql/graphql-spec#135

Until then working with the API error codes as @kbrandwijk pointed out is the way to go.

Any other suggestions are more than welcome!

@stale
Copy link

stale bot commented Jan 9, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status/stale Marked as state by the GitHub stalebot label Jan 9, 2019
@stale stale bot removed the status/stale Marked as state by the GitHub stalebot label Jan 10, 2019
@janpio janpio closed this as completed Sep 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants