flightphp / core

An extensible micro-framework for PHP
https://docs.flightphp.com
MIT License
2.64k stars 408 forks source link

How to show custom page for 500 error? #593

Closed goigarg closed 6 months ago

goigarg commented 6 months ago

If there is an error in code it just show HTTP ERROR 500

how do I make a custom html page for that ?

n0nag0n commented 6 months ago

You can see here in the docs, this is how you'd handle a not found error (404). In this case you would do something like Flight::map('error', function(Throwable $error) { /* code here */ }); instead.

https://docs.flightphp.com/learn/extending#overriding-framework-methods

krmu commented 6 months ago

And there comes example from our tests folder. https://github.com/flightphp/core/blob/10165ebda34357fc7a92dacf6c076ee957629f4f/tests/server/index.php#L174