Skip to content
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

How to show custom page for 500 error? #593

Closed
goigarg opened this issue May 18, 2024 · 2 comments
Closed

How to show custom page for 500 error? #593

goigarg opened this issue May 18, 2024 · 2 comments

Comments

@goigarg
Copy link

goigarg commented May 18, 2024

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

how do I make a custom html page for that ?

@n0nag0n
Copy link
Collaborator

n0nag0n commented May 19, 2024

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
Copy link
Contributor

krmu commented May 19, 2024

And there comes example from our tests folder.

Flight::map('error', function (Throwable $e) {

@goigarg goigarg closed this as completed May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants