Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handing in the framework #14

Open
pkucmus opened this issue Jan 17, 2022 · 0 comments
Open

Error handing in the framework #14

pkucmus opened this issue Jan 17, 2022 · 0 comments

Comments

@pkucmus
Copy link
Collaborator

pkucmus commented Jan 17, 2022

Think what we want to do with Exceptions, I'm on the fence but probably we should not enforce anything to the user's HTTP layer.

To quote myself:

I would not want to enforce a global error handler in the framework in case someone would want to deal with other GraphQL services in the app, but this brings an important topic, should those errors be HTTPErrors or should those be "framework" errors? What I'm getting at is that the framework should not enforce the error schema of an app but rather expose the ability to handle (documented) errors in the way a user of the framework wants, i.e. on SaleorAuthenticationError one would like to respond with a 403:

{
    "error": "Authentication with Saleor bad"
}

while another may want to do something like application/problem+json https://datatracker.ietf.org/doc/html/rfc7807

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant