Skip to content

[Console] Fix fatal error when logging console.error without command #22322

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
Apr 19, 2017

Conversation

chalasr
Copy link
Member

@chalasr chalasr commented Apr 6, 2017

Q A
Branch? master
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #22449
License MIT
Doc PR n/a

Happens now that the console.error event is dispatched on command not found, I ran into using server:run on 3.3 without web-server-bundle enabled:

PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function getName() on null

In this case, this first tries to cast the event input as string (less good than when the command name is available, there're extra quotes around the command name) and, if can't be casted, uses a generic message.

@chalasr chalasr force-pushed the console-error-null-cmd branch from 8f54d4c to 97129fc Compare April 6, 2017 19:41
@nicolas-grekas nicolas-grekas added this to the 3.3 milestone Apr 7, 2017
@nicolas-grekas nicolas-grekas self-requested a review April 11, 2017 17:49
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@chalasr
Copy link
Member Author

chalasr commented Apr 19, 2017

bump (the bug is annoying for upgrading from 3.2 to 3.3)

@chalasr chalasr closed this Apr 19, 2017
@chalasr chalasr reopened this Apr 19, 2017
@fabpot
Copy link
Member

fabpot commented Apr 19, 2017

Thank you @chalasr.

@fabpot fabpot merged commit 97129fc into symfony:master Apr 19, 2017
fabpot added a commit that referenced this pull request Apr 19, 2017
…ut command (chalasr)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[Console] Fix fatal error when logging console.error without command

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #22449
| License       | MIT
| Doc PR        | n/a

Happens now that the console.error event is dispatched on command not found, I  ran into using `server:run` on 3.3 without `web-server-bundle` enabled:

> PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function getName() on null

In this case, this first tries to cast the event input as string (less good than when the command name is available, there're extra quotes around the command name) and, if can't be casted, uses a generic message.

Commits
-------

97129fc Fix fatal error when logging console.error without a command
@chalasr chalasr deleted the console-error-null-cmd branch April 20, 2017 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants