Skip to content

[Console] Display the root cause in the stack strace with -vv #29232

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
lyrixx opened this issue Nov 15, 2018 · 3 comments
Closed

[Console] Display the root cause in the stack strace with -vv #29232

lyrixx opened this issue Nov 15, 2018 · 3 comments
Labels
Console DX DX = Developer eXperience (anything that improves the experience of using Symfony) Feature

Comments

@lyrixx
Copy link
Member

lyrixx commented Nov 15, 2018

Symfony version(s) affected: all

When an exception / error occurs in the console component and when the -v flag is active, an exception looks like this:

In MyCommand.php line 151:
                                                     
  [ErrorException]                                   
  Warning: Creating default object from empty value  
                                                     

Exception trace:
 MyCommand->getAmqpExchange() at MyCommand.php:115
 MyCommand->processMessage() at MyCommand.php:71
 MyCommand->execute() at /home/rio/rio/server/backend/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:251
 Symfony\Component\Console\Command\Command->run() at /home/rio/rio/server/backend/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:904
 Symfony\Component\Console\Application->doRunCommand() at /home/rio/rio/server/backend/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:89
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /home/rio/rio/server/backend/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:262
 Symfony\Component\Console\Application->doRun() at /home/rio/rio/server/backend/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:75
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /home/rio/rio/server/backend/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:145
 Symfony\Component\Console\Application->run() at /home/rio/rio/server/backend/bin/console:29

...

I can not share a screenshot (sensitive content, sorry) but my eyes want directly on the exception, then went to the stack trace.
By 2 times, I totally miss the very first line In MyCommand.php line 151:

I think we could put again the very first errors in the trace.

WDYT ?

@nicolas-grekas
Copy link
Member

makes sense to move to the stack trace when it is displayed!

@xabbuh xabbuh added Console DX DX = Developer eXperience (anything that improves the experience of using Symfony) labels Nov 16, 2018
@chalasr
Copy link
Member

chalasr commented Nov 25, 2018

See #29318

@fabpot fabpot closed this as completed Nov 26, 2018
fabpot added a commit that referenced this issue Nov 26, 2018
…se mode (chalasr)

This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Move back root exception to stack trace in verbose mode

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

Commits
-------

63cd219 [Console] Move back root exception to stack trace in verbose mode
@lyrixx
Copy link
Member Author

lyrixx commented Nov 26, 2018

Thanks @chalasr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Console DX DX = Developer eXperience (anything that improves the experience of using Symfony) Feature
Projects
None yet
Development

No branches or pull requests

6 participants