Skip to content

Commit 16ef37f

Browse files
committed
[Process] use ProcessFailedException instead of RuntimeException.
1 parent 61efc58 commit 16ef37f

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)