Skip to content

[Console] By default hide the short exception trace line from exception messages in Symfony's commands #27143

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 4, 2018

Conversation

yceruto
Copy link
Member

@yceruto yceruto commented May 3, 2018

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

After #24131 this was in my contribution list since then.

Maybe it should be taken as a good practice when we build console commands, use the exception classes of the Console component as much as possible to show a better message style to the end user.

(See the before/after effect in the referenced PR)

Copy link
Contributor

@ogizanagi ogizanagi left a comment

Choose a reason for hiding this comment

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

👌

@chalasr
Copy link
Member

chalasr commented May 4, 2018

👍 but does it really qualify as a bugfix?

@@ -179,7 +181,7 @@ private function createPasswordQuestion()

return $passwordQuestion->setValidator(function ($value) {
if ('' === trim($value)) {
throw new \Exception('The password must not be empty.');
throw new InvalidArgumentException('The password must not be empty.');
Copy link
Member Author

Choose a reason for hiding this comment

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

@chalasr It feels like a visual bug, so we're fixing the visual representation of the message, what do you think?

@nicolas-grekas
Copy link
Member

Thank you @yceruto.

@nicolas-grekas nicolas-grekas merged commit 11f3c45 into symfony:3.4 May 4, 2018
nicolas-grekas added a commit that referenced this pull request May 4, 2018
…rom exception messages in Symfony's commands (yceruto)

This PR was merged into the 3.4 branch.

Discussion
----------

[Console] By default hide the short exception trace line from exception messages in Symfony's commands

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License        | MIT
| Doc PR        | -

After #24131 this was in my contribution list since then.

Maybe it should be taken as a good practice when we build console commands, **use the exception classes of the Console component as much as possible to show a better message style to the end user**.

(See the before/after effect in the referenced PR)

Commits
-------

11f3c45 Hide short exception trace by default
@yceruto yceruto deleted the console_exception_interface branch May 4, 2018 17:52
This was referenced May 21, 2018
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.

6 participants