-
-
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
Support rendering Exceptions with previous Errors #2121
Conversation
If an Exception is thrown with an Error set as it's previous then we need to render this correctly in the error handler. This simply requires removing the type hint, however we can't do that for BC, so I've created the method `renderHtmlExceptionOrError` which is now used. Fixes #1943
* | ||
* @return string | ||
*/ | ||
protected function renderHtmlExceptionOrError($exception) |
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.
You could simplify this by hinting for Throwable instead - both Error and Exception implement this interface
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.
Throwable doesn't exist in PHP5, so it's better to be specific.
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.
Ah of course, I had forgotten about the support requirements!
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.
Looks good. Merging momentarily.
If an Exception is thrown with an Error set as it's previous then we
need to render this correctly in the error handler. This simply requires
removing the type hint, however we can't do that for BC, so I've created
the method
renderHtmlExceptionOrError
which is now used.Fixes #1943