[Process] added a Process:isSucessful() method
This commit is contained in:
parent
61f18667f4
commit
7734f44bc5
@ -235,7 +235,7 @@ abstract class Client
|
||||
$process = new PhpProcess($this->getScript($request));
|
||||
$process->run();
|
||||
|
||||
if ($process->getExitCode() > 0) {
|
||||
if (!$process->isSuccessful()) {
|
||||
throw new \RuntimeException($process->getErrorOutput());
|
||||
}
|
||||
|
||||
|
@ -194,6 +194,16 @@ class Process
|
||||
return $this->exitcode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the process ended successfully.
|
||||
*
|
||||
* @return Boolean true if the process ended successfully, false otherwise
|
||||
*/
|
||||
public function isSuccessful()
|
||||
{
|
||||
return 0 == $this->exitcode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the child process has been terminated by an uncaught signal.
|
||||
*
|
||||
|
Reference in New Issue
Block a user