Hari we can certainly discuss a change for core, but in my opinion it's important that the error message contains the word "Flarum" so a forum administrator understands which part of the software is throwing the error. Otherwise it's difficult to tell whether it's an error at the webserver level or at the Flarum level. It speeds up troubleshooting a lot when you know what fact.
You might be able to change your webserver configuration to force a given HTML file to be rendered for all 500 errors.
Changing the message in Flarum locally will require some Composer tricks to provide an override file, or place the overridden class in a different namespace and call it from index.php
. I don't think it's possible to just wrap everything in a new try/catch block, because the bit of code where this message is hard-coded is the big try/catch block that catches everything the regular Flarum error handler can't handle.
But again, that page is not supposed to be visible under normal operation. Feel free to open a new issue/discussion about your actual 500 error so we can see if we can handle this situation more gracefully and not end up with a boot error in the first place.