PluginProbe
ManageWP Worker / 4.9.25
ManageWP Worker v4.9.25
4.9.38 4.9.37 4.9.36 4.9.35 4.9.34 3.8.7 3.8.8 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.18 3.9.19 3.9.2 3.9.20 3.9.21 3.9.22 3.9.23 3.9.24 All 73 releases
worker / src / Symfony / Process / Exception / ProcessFailedException.php

ProcessFailedException.php in ManageWP Worker 4.9.25, at src/Symfony/Process/Exception/ProcessFailedException.php

50 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 /**
13 * Exception for failed processes.
14 *
15 * @author Johannes M. Schmitt <schmittjoh@gmail.com>
16 */
17 class Symfony_Process_Exception_ProcessFailedException extends Symfony_Process_Exception_RuntimeException
18 {
19 private $process;
20
21 public function __construct(Symfony_Process_Process $process)
22 {
23 if ($process->isSuccessful()) {
24 throw new Symfony_Process_Exception_InvalidArgumentException('Expected a failed process, but the given process was successful.');
25 }
26
27 $error = sprintf('The command "%s" failed.'."\nExit Code: %s(%s)",
28 $process->getCommandLine(),
29 $process->getExitCode(),
30 $process->getExitCodeText()
31 );
32
33 if (!$process->isOutputDisabled()) {
34 $error .= sprintf("\n\nOutput:\n================\n%s\n\nError Output:\n================\n%s",
35 $process->getOutput(),
36 $process->getErrorOutput()
37 );
38 }
39
40 parent::__construct($error);
41
42 $this->process = $process;
43 }
44
45 public function getProcess()
46 {
47 return $this->process;
48 }
49 }
50