Don't bother trying to set headers if not possible. #1194
Merged
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.
We often get error log reports with messages like the following:
These are of course completely useless and are caused by the error
handler trying to set the headers and failing. The issue is that the
orignal message that the error handler is supposed to output does not
make it to the logs.
This change ensures that the exception handler only tries to set headers
if they have not already been sent and updates the documentation to
encourage folk to look in the xdmod exceptions log.
I manually tested this by adding a
throw new Exception
in index.php and loading the page.