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

Cannot override SimpleDataFetcherExceptionHandler #384

Closed
@erdenebadral

Description

@erdenebadral

Hi,
Thank you for this great implementation. I am using version 7.0.1.
Facing problem with exception handling. Tried lots of different ways. like this one: https://github.com/leangen/graphql-spqr/issues/219

`@Configuration
public class GraphQLConfig {

@bean
public GraphQL graphQL(GraphQLSchema schema)
{
return GraphQL.newGraphQL(schema)
.queryExecutionStrategy(new AsyncExecutionStrategy(new CustomExceptionHandler()))
.mutationExecutionStrategy(new AsyncSerialExecutionStrategy(new CustomExceptionHandler()))
.build();
}
}Also have public class CustomExceptionHandler implements DataFetcherExceptionHandler {

@OverRide
public DataFetcherExceptionHandlerResult onException(
DataFetcherExceptionHandlerParameters handlerParameters) {

Throwable exception = handlerParameters.getException();

// do something with exception
System.out.println("asdadad");

GraphQLError error = GraphqlErrorBuilder.newError().message(exception.getMessage()).build();

return DataFetcherExceptionHandlerResult.newResult().error(error).build();

}
}`

My CustomExceptionHandler is not triggering.
Please, help to solve this issue.
P.S: I am new in GraphQL, also sorry my english.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions