Skip to content

Provide details when schema resource is invalid#307

Closed
dugenkui03 wants to merge 2 commits into
spring-projects:mainfrom
dugenkui03:patch-2
Closed

Provide details when schema resource is invalid#307
dugenkui03 wants to merge 2 commits into
spring-projects:mainfrom
dugenkui03:patch-2

Conversation

@dugenkui03

@dugenkui03 dugenkui03 commented Feb 23, 2022

Copy link
Copy Markdown
Contributor

Details about this PR in #304

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 23, 2022

private final String resourceDescription;

private final SchemaProblem schemaProblem;

@dugenkui03 dugenkui03 Feb 24, 2022

Copy link
Copy Markdown
Contributor Author

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;

throw new IllegalArgumentException("Failed to load schema resource: " + schemaResource);
}
catch (SchemaProblem ex) {
throw new InvalidSchemaResourceException(schemaResource.getDescription(), ex);

Copy link
Copy Markdown
Contributor Author

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.

@bclozel bclozel self-assigned this Feb 28, 2022
@bclozel bclozel closed this in bc7500f Mar 3, 2022
@bclozel bclozel added type: enhancement A general enhancement in: core Issues related to config and core support and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 3, 2022
@bclozel bclozel added this to the 1.0.0-M6 milestone Mar 3, 2022
@bclozel

bclozel commented Mar 3, 2022

Copy link
Copy Markdown
Member

Thanks for your contribution! I've simplified a bit things here since we don't need to rely on a particular graphql-java exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: core Issues related to config and core support type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants