Skip to content
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] Initialize lazily to render exceptions properly #23909

Merged
merged 1 commit into from
Aug 17, 2017

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

When an exception occurs in the constructor of an Application, exception handling is not yet set up.
This typically happens when the container cannot be build for some reason, where calling $this->add() builds the container and fails.

This PR makes initialization lazy so that it happens later on, when exception handling might be OK.

Before:
before

After:
after

@chalasr
Copy link
Member

chalasr commented Aug 17, 2017

Thank you @nicolas-grekas.

@chalasr chalasr merged commit 62174fd into symfony:2.7 Aug 17, 2017
chalasr added a commit that referenced this pull request Aug 17, 2017
…(nicolas-grekas)

This PR was merged into the 2.7 branch.

Discussion
----------

[Console] Initialize lazily to render exceptions properly

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

When an exception occurs in the constructor of an `Application`, exception handling is not yet set up.
This typically happens when the container cannot be build for some reason, where calling `$this->add()` builds the container and fails.

This PR makes initialization lazy so that it happens later on, when exception handling might be OK.

Before:
![before](https://user-images.githubusercontent.com/243674/29403397-7f7a1fce-8338-11e7-8e62-b6302ff0a65e.png)

After:
![after](https://user-images.githubusercontent.com/243674/29403403-83f7b5c0-8338-11e7-9a22-0c5ee702f1ff.png)

Commits
-------

62174fd [Console] Initialize lazily to render exceptions properly
@nicolas-grekas nicolas-grekas deleted the console-early-x branch August 17, 2017 11:49
This was referenced Aug 28, 2017
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.

None yet

5 participants