-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Conversation
Tests are failing. |
$process->getCommandLine(), | ||
$process->getExitCode(), | ||
$process->getExitCodeText() | ||
$process->getExitCodeText(), | ||
$process->getWorkingDirectory() |
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 think we should skip it when it get null
?
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.
The goal is to improve error information if a process fails because of the lack of user rights on the working directory.
Looks like some indentation went wrong. |
@xabbuh at the |
@@ -98,10 +103,11 @@ public function testDisabledOutputInFailedExceptionDoesNotPopulateOutput() | |||
$cmd = 'php'; | |||
$exitCode = 1; | |||
$exitText = 'General error'; | |||
$workingDirectory = getcwd(); |
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.
wrong indentation (missing 1 space)
affa688
to
4d83cea
Compare
... 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
@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", |
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.
Why the double \n?
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.
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.
Can you paste an output example?
Any news? |
Thank you @rvanlaak. |
…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
... 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?