Skip to content

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

Merged
taylorotwell merged 2 commits into
laravel:5.6from
gregoriohc:5.6
Feb 20, 2018
Merged

[5.6] Rewrite BadMethodCallException messages for consistency and always include the FQN of the class that throws the exception#23232
taylorotwell merged 2 commits into
laravel:5.6from
gregoriohc:5.6

Conversation

@gregoriohc

Copy link
Copy Markdown
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