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

custom page for http errors also #611

Open
abda11ah opened this issue Nov 26, 2024 · 5 comments
Open

custom page for http errors also #611

abda11ah opened this issue Nov 26, 2024 · 5 comments

Comments

@abda11ah
Copy link

Hi,
I saw in the source code that many http errors are directly returned as english messages like "403 unauthorized or 503 ressource unavailable etc..."

I already defined a custom template for exception errors but these errors are not rendered with it.

@n0nag0n
Copy link
Collaborator

n0nag0n commented Nov 27, 2024

Can you give me some example of how you're trying to implement it? If it's what I'm thinking, Are you referring to the Response::$codes static array with all the messages there? If that's true can you show me how you're trying to override it?

@abda11ah
Copy link
Author

abda11ah commented Dec 2, 2024

Sorry i'm not currently using this.
I just saw static "header('Location:' .....410) functions in source code.....

@n0nag0n
Copy link
Collaborator

n0nag0n commented Dec 4, 2024

So is there something that still needs to be fixed if you aren't using it anymore?

@abda11ah
Copy link
Author

abda11ah commented Dec 4, 2024

I'm currently developing a dating website with the help of bolt AI that is based on Flightphp and Cash.js.
I have many other priorities, but as I've planned the website to be multilingual, it surprised me to see static error messages in a framework without the possibility of returning them to a custom page.

@n0nag0n
Copy link
Collaborator

n0nag0n commented Dec 6, 2024

So you can actually overwrite the error method with any error that is thrown and you can put it through whatever mechanism you have for multiple languages.
https://docs.flightphp.com/learn/extending#overriding-framework-methods

Here's the list of extendable methods:
https://docs.flightphp.com/learn/api

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

2 participants