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.
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.