8000 [ErrorHandler] Do not use hyphens in exception message by jkrzefski · Pull Request #52511 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[ErrorHandler] Do not use hyphens in exception message #52511

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 2 commits into from
Apr 5, 2024

Conversation

jkrzefski
Copy link
Contributor
Q A
Branch? 6.4
Bug fix? no
New feature? no
Deprecations? no
Issues
License MIT

This is just a minor cosmetic change in the error handler. Currently, error messages are shown with hyphenation if they exceed the available with. But in technical texts like exception messages, a hyphen could give the message a slightly different meaning. To reduce the risk for confusion, I removed the hyphenation.

@jkrzefski jkrzefski requested a review from yceruto as a code owner November 9, 2023 12:23
@carsonbot carsonbot added this to the 6.4 milestone Nov 9, 2023
@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 6.4 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@nicolas-grekas nicolas-grekas modified the milestones: 6.4, 7.1 Nov 15, 2023
@fabpot
Copy link
Member
fabpot commented Dec 4, 2023

@javiereguiluz Do you like this change?

@javiereguiluz
Copy link
Member

@jkrzefski thanks for this proposal.

The problem with exception messages is that they usually include super-long "words" (e.g. FQCN) that don't fit the available space. If we don't force breaking them, the result is that the message shows big blank spaces.

Example of current exception design:

image

Same exception after this PR:

image


In any case, I agree with you that the extra - character could be confusing for some people. I looked for if the hyphens could be customized ... and I learned about hyphenate-character CSS property.

So, instead of removing this CSS class, could you please change it to add the following?

.break-long-words {
    /* ... */
    hyphenate-character: '';
}

This way, it'd look like this:

image

Thanks!

@carsonbot carsonbot changed the title Do not use hyphens in exception message [ErrorHandler] Do not use hyphens in exception message Feb 2, 2024
@javiereguiluz
Copy link
Member

I've added a commit here to make this PR mergeable. Symfony 7.1 enters "feature freeze" period next Monday and I'd like to have this included in it. Thanks!

@javiereguiluz javiereguiluz added the ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" label Apr 2, 2024
@fabpot
Copy link
Member
fabpot commented Apr 5, 2024

Thank you @jkrzefski.

@fabpot fabpot merged commit 8e06742 into symfony:7.1 Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ErrorHandler Feature ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" Status: Reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants
0