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

Add a ProcessSignaledException #25768

Closed
soullivaneuh opened this issue Jan 11, 2018 · 2 comments
Closed

Add a ProcessSignaledException #25768

soullivaneuh opened this issue Jan 11, 2018 · 2 comments

Comments

@soullivaneuh
Copy link
Contributor

Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? no
Symfony version v3.4.3

As for ProcessTimedOutException, it would be great to have an exception when a signal has been sent to the sub-process.

Basically, on this line:

if ($this->processInformation['signaled'] && $this->processInformation['termsig'] !== $this->latestSignal) {
throw new RuntimeException(sprintf('The process has been signaled with signal "%s".', $this->processInformation['termsig']));
}

This would allow to catch signaled sub-process on a higher code level and retrieve the concerned process when running many, thanks to the process property of the exception.

@lyrixx
Copy link
Member

lyrixx commented Jan 12, 2018

Hello @soullivaneuh
This is a good idea.
Do you want to submit the PR?

@soullivaneuh
Copy link
Contributor Author

Hey @lyrixx sure, I'll do it ASAP! 👍

@fabpot fabpot closed this as completed Jan 23, 2018
fabpot added a commit that referenced this issue Jan 23, 2018
…oullivaneuh)

This PR was merged into the 4.1-dev branch.

Discussion
----------

Introduce signaled process specific exception class

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

Introduced the `ProcessSignaledException` class to properly catch signaled process errors.

I took benefit to refactor process exception with a new `ProcessRuntimeException` class.

Commits
-------

68adb3b Introduce signaled process specific exception class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants