Closed llupa closed 7 months ago
Thanks for the PR 😍
Define the SYMFONY_ENDPOINT
environment variable:
# On Unix-like (BSD, Linux and macOS)
export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes/flex/pull-1296/index.json
# On Windows
SET SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes/flex/pull-1296/index.json
Install the package(s) related to this recipe:
composer req 'symfony/flex:^1.16'
composer req 'symfony/console:^6.4'
Don't forget to unset the SYMFONY_ENDPOINT
environment variable when done:
# On Unix-like (BSD, Linux and macOS)
unset SYMFONY_ENDPOINT
# On Windows
SET SYMFONY_ENDPOINT=
In order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes. I'm going keep this comment up to date with any updates of the attached patch.
This would be a work around. Let's fix the root issue instead, see https://github.com/symfony/symfony/pull/54189
@nicolas-grekas I think aside of this issue that triggered this PR, we might want to still do this.
The console app now defaults to catchExceptions: true
and catchErrors: false
. I think it makes sense to make both true
in Symfony 8, meaning the console terminate event is dispatched for both exceptions and errors.
Thus we can do the traditional BC cycle here: deprecate not setting catchErrors, change recipe to always use new default (this PR), and in 8.0, swap default around, undeprecate not setting catchErrors and update recipe to not override the default.
What do you think?
(btw, thanks for providing a patch in the error handler!)
Not as detailed as Wouter's comment, but I also will have to set it to true for my projects because I cannot really think of a use case (DX) where I want Exceptions to be caught and rendered one way, but Errors not caught (probably will be after your patch) but rendered a different way.
Maybe it boils down to personal preference, but it is odd that it works differently for one from the other.
I think we should minimize those flip-flap with deprecations so I'd better not change anything personally.
Also the current logic is perfectly fine to me. Error
are split from Exception
because they're not the same beast.
Pinging @wouterj @greg0ire
This is my first time doing "recipe" work and I am not sure if this is the correct place to open this PR. Let me know for any change needed!
In short: when executing console commands in production mode/env commands have to fail with exit 1, and not render the
\Error
and exit 0.