Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Support NullPointerException in ErrorHandler #896

Open
gschei opened this issue Nov 30, 2022 · 0 comments
Open

Support NullPointerException in ErrorHandler #896

gschei opened this issue Nov 30, 2022 · 0 comments

Comments

@gschei
Copy link

gschei commented Nov 30, 2022

Currently if a resolver throws a NullPointerException it cannot be handled by the ErrorHandler, because GraphqlErrorBuilder has a assertNotNull on the message and NullPointerException does not return a Message.

Assert.assertNotNull(this.message, () -> {
return "You must provide error message";
});

I would suggest to enhance the GraphQLErrorFromExceptionHandler to set the Message alternatively with eg. the className. Then a NullPointerException would be handled gracefully and remaining data would be returned.

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

1 participant