Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a backport from PR #33323 to the 6.x branch
The goal is to allow to report a reportable exception with the default handler by simply returning false from the report method.
The backport suggestion was made by issue #37213 where the issue's author noted if an error happens when rendering a blade view, and no dev dependencies are installed (e.g. in production), the error does not get logged to the log file.
I tested in a local installation and now it does.
One difference from PR #33323 is that in Laravel 6.x, a value returned from a reportable exception's
report
method is returned:So to avoid breaking changes for developers expecting such behavior, I still return the returned value, unless it is
false
If the developer is manually calling the Exception handler
report
method and expecting false, this would be a breaking change.But as the docblock states the
report
method return value should bevoid
, I guess it is very unlikely someone is using the report handler this way.Let me know if you prefer to change it to be the same as #33323 and I will change the PR to it.
Closes #37213