Skip to content

Include object name in editor exception messages #6943

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
May 3, 2025

Conversation

morozov
Copy link
Member

@morozov morozov commented May 3, 2025

This PR includes the object name in the messages of the exceptions thrown by the corresponding editor (suggested in #6934 (comment)).

The pattern is the following:

  1. For the objects that must be named (e.g. Table, Index), accept the object name in all static constructors of the Invalid{Object}Definition exception except for nameNotSet(). The logic is that if the name is not set, nameNotSet() would be thrown, so if a different exception is being constructed, the name is set.
  2. For the objects that can be optionally named (e.g. UniqueConstraint, ForeignKeyConstraint), accept the nullable object name in all static constructors except for nameNotSet(). If the name is not set, display <unnamed> instead of the name.

@morozov morozov added this to the 4.3.0 milestone May 3, 2025
@morozov morozov marked this pull request as ready for review May 3, 2025 15:34
@morozov morozov requested a review from greg0ire May 3, 2025 15:34
@morozov morozov merged commit 6510689 into doctrine:4.3.x May 3, 2025
95 checks passed
@morozov morozov deleted the editor-exception-messages branch May 3, 2025 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants