- 
                Notifications
    
You must be signed in to change notification settings  - Fork 330
 
Closed
Labels
in: coreIssues related to config and core supportIssues related to config and core supporttype: enhancementA general enhancementA general enhancement
Milestone
Description
Our @GraphQlExceptionHandler example in the reference documentation shows the following:
@GraphQlExceptionHandler
public GraphQLError handle(BindException ex) {
	return GraphQLError.newError().errorType(ErrorType.BAD_REQUEST).message("...").build();
}Doing so would return the error in the error map, but would miss critical information like "path" and "location".
You can get a better result with:
@GraphQlExceptionHandler
public GraphQLError handle(DataFetchingEnvironment environment, IllegalStateException ex) {
	return GraphqlErrorBuilder.newError(environment).errorType(ErrorType.BAD_REQUEST).message("...").build();
}We should consider whether we should document this approach, or make available a GraphqlErrorBuilder parameter for error handlers with location/path information available from the environment.
Metadata
Metadata
Assignees
Labels
in: coreIssues related to config and core supportIssues related to config and core supporttype: enhancementA general enhancementA general enhancement