Skip to content

Commit d85b865

Browse files
committed
minor #5797 [Process] use ProcessFailedException instead of RuntimeException. (aitboudad)
This PR was merged into the 2.7 branch. Discussion ---------- [Process] use ProcessFailedException instead of RuntimeException. | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | all | Fixed tickets | symfony/symfony#16269 Commits ------- 16ef37f [Process] use ProcessFailedException instead of RuntimeException.
2 parents abc28e7 + 16ef37f commit d85b865

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/process.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ The :class:`Symfony\\Component\\Process\\Process` class allows you to execute
2424
a command in a sub-process::
2525

2626
use Symfony\Component\Process\Process;
27+
use Symfony\Component\Process\Exception\ProcessFailedException;
2728

2829
$process = new Process('ls -lsa');
2930
$process->run();
3031

3132
// executes after the command finishes
3233
if (!$process->isSuccessful()) {
33-
throw new \RuntimeException($process->getErrorOutput());
34+
throw new ProcessFailedException($process);
3435
}
3536

3637
echo $process->getOutput();

0 commit comments

Comments
 (0)