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

[5.6] Rewrite BadMethodCallException messages for consistency and always include the FQN of the class that throws the exception #23232

Merged
merged 2 commits into from
Feb 20, 2018

Conversation

gregoriohc
Copy link
Contributor

The objective of the proposed changes is to make the messages of the BadMethodCallException exceptions more consistent in the framework, always including the FQN of the class where the exceptions is thrown, since in many cases the exception is thrown by a trait (ex: Macroable) making the debugging more complicated.

This way, what would previously generate an error by console with this message:

BadMethodCallException: Method hello does not exist.
/.../vendor/laravel/framework/src/Illuminate/Support/Traits/Macroable.php:75
...

Now it generates the following message:

BadMethodCallException: Method Illuminate\Database\Eloquent\Collection::hello does not exist.
/.../vendor/laravel/framework/src/Illuminate/Support/Traits/Macroable.php:75
....

The tests have also been updated to reflect the changes.

@gregoriohc gregoriohc changed the title Rewrite BadMethodCallException messages for consistency and always include the FQN of the class that throws the exception [5.6] Rewrite BadMethodCallException messages for consistency and always include the FQN of the class that throws the exception Feb 20, 2018
@taylorotwell taylorotwell merged commit c29871e into laravel:5.6 Feb 20, 2018
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.

2 participants