Skip to content

[Uid] Add component-specific exception classes #20900

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
nicolas-grekas opened this issue Apr 17, 2025 · 5 comments
Closed

[Uid] Add component-specific exception classes #20900

nicolas-grekas opened this issue Apr 17, 2025 · 5 comments
Labels
Milestone

Comments

@nicolas-grekas
Copy link
Member

Q A
Feature PR symfony/symfony#60226
PR author(s) @rela589n
Merged in 7.3

We created this issue to not forget to document this new feature. We would really appreciate if you can help us with this task. If you are not sure how to do it, please ask us and we will help you.

To fix this issue, please create a PR against the 7.3 branch in the symfony-docs repository.

Thank you! 😃

@nicolas-grekas nicolas-grekas added this to the 7.3 milestone Apr 17, 2025
@carsonbot carsonbot added the Uid label Apr 17, 2025
@xabbuh
Copy link
Member

xabbuh commented Apr 17, 2025

not sure if that's something that really needs to be added to the docs

@rela589n
Copy link

Hi, @nicolas-grekas , this isn't complete. I think it would be fine if followed by one more PR

@nicolas-grekas
Copy link
Member Author

Please send the PR if you want to rediscuss of course. I engaged in the discussion but other people or arguments might shed another light.

@rela589n
Copy link

Hello @nicolas-grekas !

I want to rise again the topic of valued exceptions.

The primary use case of this would be that the value will appear in logs, ready for the analysis.

For example, condiser the application where we'd receive messages from a separate system and then process them. External system might not enforce the invariants they say to enforce, and it happens that they publish values that are not uuid, although they thought them to be so. In this case we'd like to know what actual invalid uuids they have provided. If we use fromBase32 or some other Uuid factory methods providing no context, we would not find the value.

I propose to add the value to the exception, so that after being serialized by the log processor, the value will finally appear in logs. Thus exception context could easily appear in logs as dedicated fields, which can be filtered by, and grouped by.

@xabbuh
Copy link
Member

xabbuh commented Apr 30, 2025

Please send a PR to the Symfony code repository with the changes that you in mind to gather feedback on your idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants