-
-
Notifications
You must be signed in to change notification settings - Fork 834
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
Hide boot error #2633
Hide boot error #2633
Conversation
…nabled. Attempt to use Flarum log file when possible. Fixes #2290
[ci skip] [skip ci]
There's one thing you could give me input on: do you think the two special cases (debug mode and logger available) should be wrapped in a
The remaining extensible aspect is if an extension binds to the |
As incredibly niche as this edge case is, I'm leaning towards handling it too, just so we don't need to worry about it ever again. |
It does seem a bit overkill now, but at least everything should be covered. I also moved the code into methods that more accurately describe what is ideal and what is fallback. |
|
||
// Throwing the exception ensures it will be visible with PHP display_errors=On | ||
// but invisible if that feature is turned off | ||
// PHP will also automatically choose a valid place to log it based on the system settings |
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.
This last line of the comment feels redundant given the contents of the echo above
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.
Sure, I could remove it
Fixes #2290
Changes proposed in this pull request:
Completely redact boot error unless debug mode or display_errors is enabled. Attempt to use Flarum log file when possible.
Use HTTP error code 500 whenever a boot error occurs, whatever the handling method is.
Reviewers should focus on:
Screenshot
If debug mode is enabled, most errors will look exactly as before:
If debug mode is disabled, most errors including database and extension related will end up showing this:
If an error happened even earlier, which is unlikely, the error will appear in one of two ways (example: the file
vendor/flarum/core/src/Foundation/Application.php
is missing).If
display_errors
isOff
:If
display_errors
isOn
:Confirmed
composer test
).