Skip to content

Add more details to exception messages in FormatManager #7825

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

Merged
merged 1 commit into from
Mar 5, 2025

Conversation

michaelzangerle
Copy link
Contributor

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets -
Related issues/PRs -
License MIT
Documentation PR -

What's in this PR?

Improves the exception messages.

Why?

Generic exception messages are not helpful when debugging bugs. Examples before and after:

Media was not found => Media with id "%s" was not found.
Requested FileVersion for media was not found => Requested FileVersion "%s" for media with id "%s" was not found.

@michaelzangerle
Copy link
Contributor Author

@Prokyonn As discussed. 🙂

@alexander-schranz alexander-schranz added the DX Affecting the end developer label Mar 5, 2025
@alexander-schranz alexander-schranz changed the title Adds more details to exception messages in FormatManager Add more details to exception messages in FormatManager Mar 5, 2025
Copy link
Member

@Prokyonn Prokyonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, looks good 👍

@michaelzangerle can you please change the target branch to 2.5 and rebase it

@michaelzangerle michaelzangerle changed the base branch from 2.6 to 2.5 March 5, 2025 11:56
@michaelzangerle michaelzangerle force-pushed the improve-exception-messages branch from 0bf3377 to a2efd27 Compare March 5, 2025 12:37
@michaelzangerle
Copy link
Contributor Author

@Prokyonn Done 🙂

@Prokyonn Prokyonn enabled auto-merge (squash) March 5, 2025 13:58
@Prokyonn Prokyonn disabled auto-merge March 5, 2025 14:27
@Prokyonn Prokyonn merged commit cf8d5ba into sulu:2.5 Mar 5, 2025
16 of 18 checks passed
@alexander-schranz
Copy link
Member

alexander-schranz commented Mar 5, 2025

Looks like the tests unexpectly is outputting something the cli directly now Error: ...

Bildschirmfoto 2025-03-05 um 17 18 12

Bildschirmfoto 2025-03-05 um 17 15 47

Think cleanLogs is missing in teardown else __destruct outputs errors: https://github.com/symfony/symfony/blob/a9a122681e2da8c94496195c63337d7f365f204a/src/Symfony/Component/ErrorHandler/BufferingLogger.php#L48

@michaelzangerle
Copy link
Contributor Author

@alexander-schranz Should be fixed in here #7837 🙂

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

Successfully merging this pull request may close these issues.

3 participants