-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
refactor: replace $e->getMessage() with $e in log_message() #6182
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice touch. Modifying log entries does not affect our API, I would not consider this a breaking change at all - fine by me to switch branches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a user who is an advocate of declare(strict_types=1);
. Can you cast to string the $e
so that string is still passed to $message
? I don't want to read another forum post or issue regarding this, please.
Exceptions are already Stringable: https://www.php.net/manual/en/exception.tostring.php ... so are allowed without casting. |
Nope, you were right @paulbalandan:
I didn't realize that difference in behavior - unfortunate. |
246a24b
to
64fa01f
Compare
64fa01f
to
8754dec
Compare
Description
Depending on exception classes, but generally
(string) $e
has more info than$e->getMessage()
.If this is not BC, then I would change the base branch todevelop
.$e->getMessage()
:$e
:Checklist: