Skip to content

Include working directory in ProcessFailedException #14908

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
Oct 5, 2015

Conversation

rvanlaak
Copy link
Contributor

@rvanlaak rvanlaak commented Jun 8, 2015

... because quite often the Exception is a result of the www-data user not having the appropriate rights at that working path. Maybe @schmittjoh can confirm this?

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

@jakzal
Copy link
Contributor

jakzal commented Jun 8, 2015

Tests are failing.

$process->getCommandLine(),
$process->getExitCode(),
$process->getExitCodeText()
$process->getExitCodeText(),
$process->getWorkingDirectory()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should skip it when it get null ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The goal is to improve error information if a process fails because of the lack of user rights on the working directory.

@xabbuh
Copy link
Member

xabbuh commented Jun 9, 2015

Looks like some indentation went wrong.

@rvanlaak
Copy link
Contributor Author

rvanlaak commented Jun 9, 2015

@xabbuh at the ProcessFailedExceptionTest you mean? Should be fixed now, let me know if a rebase is needed.

@@ -98,10 +103,11 @@ public function testDisabledOutputInFailedExceptionDoesNotPopulateOutput()
$cmd = 'php';
$exitCode = 1;
$exitText = 'General error';
$workingDirectory = getcwd();
Copy link
Member

Choose a reason for hiding this comment

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

wrong indentation (missing 1 space)

@rvanlaak rvanlaak force-pushed the patch-2 branch 3 times, most recently from affa688 to 4d83cea Compare June 10, 2015 15:06
... because quite often the Exception is a result of the `www-data` user not having the appropriate rights at that path.

fixed ProcessFailedException tests

Update ProcessFailedExceptionTest.php

fix indention

fixed indention
@rvanlaak
Copy link
Contributor Author

@jakzal you think this PR can be merged?

@@ -28,10 +28,11 @@ public function __construct(Process $process)
throw new InvalidArgumentException('Expected a failed process, but the given process was successful.');
}

$error = sprintf('The command "%s" failed.'."\nExit Code: %s(%s)",
$error = sprintf('The command "%s" failed.'."\n\nExit Code: %s(%s)\n\nWorking directory: %s",
Copy link
Member

Choose a reason for hiding this comment

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

Why the double \n?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Can you paste an output example?

@fabpot
Copy link
Member

fabpot commented Aug 1, 2015

Any news?

@fabpot
Copy link
Member

fabpot commented Oct 5, 2015

Thank you @rvanlaak.

@fabpot fabpot merged commit dbaefb4 into symfony:2.8 Oct 5, 2015
fabpot added a commit that referenced this pull request Oct 5, 2015
…vanlaak)

This PR was merged into the 2.8 branch.

Discussion
----------

Include working directory in ProcessFailedException

... because quite often the Exception is a result of the `www-data` user not having the appropriate rights at that working path. Maybe @schmittjoh can confirm this?

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

Commits
-------

dbaefb4 Include working directory in ProcessFailedException
@fabpot fabpot mentioned this pull request Nov 16, 2015
@rvanlaak rvanlaak deleted the patch-2 branch March 23, 2016 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants