laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.64k stars 11.04k forks source link

Output clean error page on health check route #53528

Closed chrispage1 closed 3 days ago

chrispage1 commented 1 week ago

Hi,

I've made a couple of tweaks to the application health route.

  1. Rather than depending on Tailwind CDN, I've inlined the CSS.

  2. Exceptions thrown by the DiagnosingHealth event will be captured and a health flag set. If debug mode is enabled, the error will be re-thrown. If debug mode is disabled, the error will be reported and the exception message passed down to the health page.

Based on this, the application health page will then show an error, rather than just outputting a '500 | Server Error' page as it would by default. This still throws a 500 server error so can be picked up by monitoring tools.

image

I hope you'll give this some consideration! Thanks.

taylorotwell commented 6 days ago

Can you revert the CDN changes?

chrispage1 commented 6 days ago

Hi @taylorotwell - I've made this change. Cheers.