8000 [Console] Display errors even when --quiet is present by Bratstock · Pull Request #37796 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Console] Display errors even when --quiet is present #37796

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
wants to merge 2 commits into from

Conversation

Bratstock
Copy link

When using SymfonyStyle::error the message should be printed even when
the --quiet option is used.

Q A
Branch? 5.1
Bug fix? yes
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR Error messages should always be visible. The changes fix this problem at the first point where verbosity can be changed.

When using SymfonyStyle::error the message should be printed even when
the --quiet option is used.
@YaFou
Copy link
Contributor
YaFou commented Aug 10, 2020

I'm not sure about this change. Can this pull request be considered like a breaking change? This needs discussion. Quiet means no printing anything in the terminal but what the use case to print nothing? We need to catch errors more easily in a CI with this flag I think. Maybe someone have a good reason to keep it like before.

@Bratstock
Copy link
Author

I think quiet means suppressing normal output, but not error messages. A similar discussion ran under #15680 a few years ago.

@fabpot
Copy link
Member
fabpot commented Aug 11, 2020

The referenced issue also come with a related PR (#15773). I don't think we need to do more than that as explained in the linked discussions.

@fabpot fabpot closed this Aug 11, 2020
@Bratstock
Copy link
Author

@fabpot I think you are not quite right. In my opinion, the exception is the smaller problem. I can catch an exception in the program and fix or bypass the cause. Only if I don't do that, the exception turns into an error. This should make errors more serious than exceptions. The PR #15773 prints out exceptions in quiet mode that were not caught.

So you mean that if I, as a programmer, intercept and process all exceptions and discover that I cannot solve all problems, I shouldn't tell the user what went wrong and I cannot terminate the program properly? Instead, do I have to throw an exception and hope that it is not caught elsewhere and possibly ignored?
Hmm, then I've probably misunderstood the handling of exceptions so far. What is the "SymfonyStyle->error()" function useful for when I "have to" generate exceptions to inform the user unconditionaly?
Btw. I also think that errors should be print to stderr rather than stdout. But that will be a bit more complex, I think.

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.

4 participants
0