-
Notifications
You must be signed in to change notification settings - Fork 317
Provide details when schema resource is invalid #307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
private final String resourceDescription; | ||
|
||
private final SchemaProblem schemaProblem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SchemaProblem will be changed from internal to publicApi, we are free to use it, details in issues 2734;
@@ -193,6 +194,9 @@ private TypeDefinitionRegistry parseSchemaResource(Resource schemaResource) { | |||
catch (IOException ex) { | |||
throw new IllegalArgumentException("Failed to load schema resource: " + schemaResource); | |||
} | |||
catch (SchemaProblem ex) { | |||
throw new InvalidSchemaResourceException(schemaResource.getDescription(), ex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason to create InvalidSchemaResourceException is that I think the 'wrong schema config' not match the semantic of IllegalArgumentException.
Thanks for your contribution! I've simplified a bit things here since we don't need to rely on a particular graphql-java exception. |
Details about this PR in #304