Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[RFC] Translatable HTTP exceptions #49687

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

Closed
ro0NL opened this issue Mar 14, 2023 · 1 comment
Closed

[RFC] Translatable HTTP exceptions #49687

ro0NL opened this issue Mar 14, 2023 · 1 comment
Labels
RFC RFC = Request For Comments (proposals about features that you want to be discussed)

Comments

@ro0NL
Copy link
Contributor

ro0NL commented Mar 14, 2023

Description

This would solve #49653 and also play nice with #[WithHttpStatus(4xx)].

The idea is any HttpException can be given a translatable message:

throw new HttpException(400, t('id'));

Im just not sure if the normalizer should expose any translatable message, or just 4xx ones.
edit: actually i think translatable messages should always be exposed, even 5xx responses could use some helpful hints for the user 😅

but then the line between what's exposed, and what's not becomes super thin, so maybe this needs a new new ExposedHttpException() / new HttpException(expose: true)

Example

No response

@carsonbot carsonbot added the RFC RFC = Request For Comments (proposals about features that you want to be discussed) label Mar 14, 2023
@ro0NL ro0NL closed this as completed Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC RFC = Request For Comments (proposals about features that you want to be discussed)
Projects
None yet
Development

No branches or pull requests

2 participants