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

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

Closed
lyrixx opened this Issue Nov 15, 2018 · 3 comments

Comments

Projects
None yet
6 participants
@lyrixx
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

This comment has been minimized.

Member

nicolas-grekas commented Nov 15, 2018

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

@chalasr

This comment has been minimized.

Member

chalasr commented Nov 25, 2018

See #29318

@fabpot fabpot closed this Nov 26, 2018

fabpot added a commit that referenced this issue Nov 26, 2018

bug #29318 [Console] Move back root exception to stack trace in verbo…
…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

This comment has been minimized.

Member

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