-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Ensure __toString()
catches all error types
#21545
Ensure __toString()
catches all error types
#21545
Conversation
In PHP 7.1 `catch (\Exception ...)` does not catch fatal errors. Because this function can possibly throw fatal errors such as "`Call to a member function getRequestFieldName() on null`" which is an instance of `\Error`, we should catch `\Throwable` to ensure the exception makes it into the logger and `$result` is assigned the message.
Hi @tylerssn. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
Hi @rogyar, thank you for the review. |
@tylerssn thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
Done, @magento-engcom-team. Thank you. |
✔️ QA Passed |
Hi @tylerssn, thank you for your contribution! |
Description (*)
In PHP 7.1
catch (\Exception ...)
does not catch fatal errors. Because this function can possibly throw fatal errors such as "Call to a member function getRequestFieldName() on null
" which is an instance of\Error
, we should catch\Throwable
to ensure the exception makes it into the logger and$result
is assigned the message.Fixed Issues (if relevant)
Contribution checklist (*)