Skip to content

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

@lyrixx

Description

@lyrixx

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    ConsoleDXDX = Developer eXperience (anything that improves the experience of using Symfony)Feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy