The purpose of this pull request is to prevent the Sentry capture phase from crashing if the underlying error is not ExceptionWhileDataFetching but something else instead. These types of error usually come up when the incoming QraphQL query is not properly built or it does not match the schema.
Previously the server would return an HTTP 500 result with a message similar to:
"java.lang.ClassCastException: graphql.validation.ValidationError cannot be cast to graphql.ExceptionWhileDataFetching graphql.validation.ValidationError cannot be cast to graphql.ExceptionWhileDataFetching"
Now the server still returns an HTTP 500 result but with a better error message:
{
"errors": [
{
"validationErrorType": "FieldUndefined",
"message": "Validation error of type FieldUndefined: Field asdf is undefined",
"errorType": "ValidationError",
"locations": [
{
"line": 135,
"column": 62
}
]
}
]
}
The purpose of this pull request is to prevent the Sentry capture phase from crashing if the underlying error is not ExceptionWhileDataFetching but something else instead. These types of error usually come up when the incoming QraphQL query is not properly built or it does not match the schema.
Previously the server would return an HTTP 500 result with a message similar to:
"java.lang.ClassCastException: graphql.validation.ValidationError cannot be cast to graphql.ExceptionWhileDataFetching graphql.validation.ValidationError cannot be cast to graphql.ExceptionWhileDataFetching"
Now the server still returns an HTTP 500 result but with a better error message: