Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Console][Messenger] addRunCommandMessage andRunCommandMessageHandler#49814
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ExecuteCommand andExecuteCommandHandlerExecuteCommand andExecuteCommandHandlerkbond commentedMar 25, 2023
Like#49813 (comment), maybe |
| $input = new StringInput($message->input); | ||
| $output = new BufferedOutput(); | ||
| $this->application->setCatchExceptions($message->catchExceptions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Should I clone the application here instead of having the service not-shared?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
maybe try/finally to modify state on the shared service?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I don't think I can do this as there's no way to access the current state ofApplication::$catchExceptions.
src/Symfony/Component/Console/Messenger/ExecuteCommandHandler.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
848bdb7 tof712569Comparesrc/Symfony/Component/Console/Messenger/ExecuteCommandHandler.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
kbond commentedMar 28, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
One thing I think is missing: making the output available if there's an exception. Consider a system that tracks messages and emails an admin on failure. I can attest that this is valuable information. What about wrapping the caught exception in a new In#49813 this is possible because the thrown exception ( |
| ) { | ||
| } | ||
| public function __toString(): string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
see also#49813 (comment)
Uh oh!
There was an error while loading.Please reload this page.
| $input = new StringInput($message->input); | ||
| $output = new BufferedOutput(); | ||
| $this->application->setCatchExceptions($message->catchExceptions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
maybe try/finally to modify state on the shared service?
src/Symfony/Component/Console/Messenger/ExecuteCommandHandler.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Console/Messenger/ExecuteCommandHandler.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
kbond commentedJul 28, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I've updated this PR:
(updated PR description to show usage) |
ExecuteCommand andExecuteCommandHandlerRunCommandMessage andRunCommandMessageHandler
fabpot left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM,@kbond I've made a rename suggestion.
Uh oh!
There was an error while loading.Please reload this page.
fabpot commentedJul 30, 2023
Thank you@kbond. |
Uh oh!
There was an error while loading.Please reload this page.
Similar to#49813, when using the scheduler it could be useful to execute commands.
Usage
TODO: