class ProcessFailedException
Exception for failed processes.
@author Johannes M. Schmitt <schmittjoh@gmail.com>
Hierarchy
- class \Symfony\Component\Process\Exception\RuntimeException extends \Symfony\Component\Process\Exception\RuntimeException implements \Symfony\Component\Process\Exception\ExceptionInterface
- class \Symfony\Component\Process\Exception\RuntimeException extends \Symfony\Component\Process\Exception\RuntimeException implements \Symfony\Component\Process\Exception\ExceptionInterface
- class \Symfony\Component\Process\Exception\ProcessFailedException extends \Symfony\Component\Process\Exception\RuntimeException
- class \Symfony\Component\Process\Exception\RuntimeException extends \Symfony\Component\Process\Exception\RuntimeException implements \Symfony\Component\Process\Exception\ExceptionInterface
Expanded class hierarchy of ProcessFailedException
5 files declare their use of ProcessFailedException
- PackageManagerFixtureCreator.php in core/
scripts/ PackageManagerFixtureCreator.php - Plugin.php in vendor/
dealerdirect/ phpcodesniffer-composer-installer/ src/ Plugin.php - Process.php in vendor/
symfony/ process/ Process.php - ProcessHelper.php in vendor/
symfony/ console/ Helper/ ProcessHelper.php - RunProcessMessageHandler.php in vendor/
symfony/ process/ Messenger/ RunProcessMessageHandler.php
File
-
vendor/
symfony/ process/ Exception/ ProcessFailedException.php, line 21
Namespace
Symfony\Component\Process\ExceptionView source
class ProcessFailedException extends RuntimeException {
public function __construct(Process $process) {
if ($process->isSuccessful()) {
throw new InvalidArgumentException('Expected a failed process, but the given process was successful.');
}
$error = \sprintf('The command "%s" failed.' . "\n\nExit Code: %s(%s)\n\nWorking directory: %s", $process->getCommandLine(), $process->getExitCode(), $process->getExitCodeText(), $process->getWorkingDirectory());
if (!$process->isOutputDisabled()) {
$error .= \sprintf("\n\nOutput:\n================\n%s\n\nError Output:\n================\n%s", $process->getOutput(), $process->getErrorOutput());
}
parent::__construct($error);
$this->process = $process;
}
public function getProcess() : Process {
return $this->process;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overrides |
---|---|---|---|---|
ProcessFailedException::getProcess | public | function | 1 | |
ProcessFailedException::__construct | public | function | 1 |