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

Add missing constructor parameters to error message #433

Merged
merged 1 commit into from
May 5, 2023
Merged

Add missing constructor parameters to error message #433

merged 1 commit into from
May 5, 2023

Conversation

Sparclex
Copy link
Contributor

@Sparclex Sparclex commented May 3, 2023

Currently only the given parameters are displayed when failing to create a data object. But if a Data Object has a lot of parameters it is hard to find the missing property.

This PR suggests displaying the missing constructor property names as well in the error message.

@innocenzi
Copy link
Contributor

I was on the verge of PRing this. This would be very welcome, and I even suggest swapping "parameters given" and "parameters missing" so the latter becomes first. We could go as far as removing "parameters given" maybe.

@rubenvanassche
Copy link
Member

Thanks!

@rubenvanassche rubenvanassche merged commit fd4734c into spatie:main May 5, 2023
@Sparclex
Copy link
Contributor Author

Sparclex commented May 5, 2023

I was on the verge of PRing this. This would be very welcome, and I even suggest swapping "parameters given" and "parameters missing" so the latter becomes first. We could go as far as removing "parameters given" maybe.

Yes I think changing the order would be even better. But I would not remove "parameters given" since it already helped me sometimes, when I forgot to add MapName for example.

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.

3 participants