Skip to content
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

Throw a helpful exception if a referenced blueprint does not exist #3977

Merged
merged 9 commits into from
Jul 19, 2021
Merged

Throw a helpful exception if a referenced blueprint does not exist #3977

merged 9 commits into from
Jul 19, 2021

Conversation

duncanmcclean
Copy link
Member

@duncanmcclean duncanmcclean commented Jul 8, 2021

This pull request adds a helpful exception that'll be thrown if a specified blueprint does not exist. I've added an Ignition solution to the exception that'll suggest any blueprints close ish to the specified one (done the same way as in the CollectionNotFoundException)

Closes #3920

Ignition Exception

image

Copy link
Member

@jasonvarga jasonvarga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we call it BlueprintNotFoundException? We use the "not found" pattern all over. You even use it in the message. 😄

@duncanmcclean
Copy link
Member Author

duncanmcclean commented Jul 8, 2021

Can we call it BlueprintNotFoundException? We use the "not found" pattern all over. You even use it in the message. 😄

One step ahead of you, see dd72ea2.

@jasonvarga
Copy link
Member

I don't know how helpful the suggestions are.

I renamed a blueprint in order to see the error.
Then the exception said Did you mean user? so I changed my entry to blueprint: user

Then I get this, which is probably even more confusing.

image

If we want to provide suggestions, maybe we should pass in the namespace so it only suggests ones that would work.

@jasonvarga
Copy link
Member

It's an easy fix, I'll just do it 👍

@jasonvarga jasonvarga merged commit 080d3e7 into statamic:3.1 Jul 19, 2021
@duncanmcclean duncanmcclean deleted the fix/3920 branch July 19, 2021 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Entry breaks if the blueprint does not exist
3 participants