Skip to content

[Console] Adding more helpful error messages to the Questionhelper #61308

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
Aug 6, 2025

Conversation

mamazu
Copy link
Contributor

@mamazu mamazu commented Aug 2, 2025

Q A
Branch? 7.4
Bug fix? no
New feature? yes
Deprecations? no
Issues -
License MIT

When trying to debug, having an error like this is not very helpful:

1) Sylius\Bundle\GridBundle\Tests\Functional\Maker\MakeGridTest::it_can_create_grids_interactively
Symfony\Component\Console\Exception\MissingInputException: Aborted.

symfony/console/Helper/QuestionHelper.php:273
symfony/console/Helper/QuestionHelper.php:139
symfony/console/Helper/QuestionHelper.php:65
symfony/console/Helper/QuestionHelper.php:473
symfony/console/Helper/QuestionHelper.php:67
symfony/console/Style/SymfonyStyle.php:307
symfony/console/Style/SymfonyStyle.php:247

When trying to debug where the error is actually coming from. More helpful would be:

1) Sylius\Bundle\GridBundle\Tests\Functional\Maker\MakeGridTest::it_can_create_grids_interactively
Symfony\Component\Console\Exception\MissingInputException: Aborted while asking: Entity class to create a grid for

@mamazu mamazu force-pushed the more_helpful_errors branch from 7de3250 to 9aa3023 Compare August 2, 2025 21:25
@mamazu
Copy link
Contributor Author

mamazu commented Aug 3, 2025

This issue has been incorrectly tagged with deprecation.

But I would also be happy to apply this to a lower version of Symfony so that more people can have better error messages.

@carsonbot carsonbot changed the title Adding more helpful error messages to the Questionhelper [Console] Adding more helpful error messages to the Questionhelper Aug 3, 2025
@fabpot
Copy link
Member

fabpot commented Aug 6, 2025

FYI, such improvements are always merged for the next version.

@fabpot
Copy link
Member

fabpot commented Aug 6, 2025

Thank you @mamazu.

@fabpot fabpot merged commit d0118a9 into symfony:7.4 Aug 6, 2025
11 of 12 checks passed
@mamazu mamazu deleted the more_helpful_errors branch August 6, 2025 06:53
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.

5 participants