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

Make it possible to add custom extensions to errors #773

Closed
piotrblasiak opened this issue May 4, 2021 · 2 comments
Closed

Make it possible to add custom extensions to errors #773

piotrblasiak opened this issue May 4, 2021 · 2 comments
Labels
enhancement New feature or request Server This issue applies to the Server side

Comments

@piotrblasiak
Copy link

It would be great to be able to add extensions to errors. Some useful extensions that I use in other graphql apis:

reference - generated by the error handler on every time the error is logged and shown to the end-user they can send to the app support and get help.
userFriendlyMessage - "Your account has been disabled." or other end-user oriented messages.

@t1
Copy link
Collaborator

t1 commented May 5, 2021

Thanks for the input.

reference - generated by the error handler on every time the error is logged and shown to the end-user they can send to the app support and get help.

RFC-7807 "Problem Details for HTTP APIs" defines a similar field, but calls it instance. They suggest this to be a URI, of course, as it's for REST, but it can actually be useful to directly have a URL you can 'click on' to see the logs (if you have the privileges to see them).

We've been discussing this briefly in #299.

userFriendlyMessage - "Your account has been disabled." or other end-user oriented messages.

There's already the message field for this purpose. The exception message is used for that, if the exception is in the mp.graphql.showErrorMessage configuration, or it's a checked exception and not in the mp.graphql.hideErrorMessage configuration.

If you agree, we could move the discussion to #299 and close this as a duplicate?

@t1 t1 added enhancement New feature or request Server This issue applies to the Server side labels May 5, 2021
@piotrblasiak
Copy link
Author

I agree that this is a duplicate and we can move the discussion to #299.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Server This issue applies to the Server side
Projects
None yet
Development

No branches or pull requests

2 participants