Skip to content

Commit fd8cf8b

Browse files
[11.x] Expose process checkTimeout method (#54912)
* Expose checkTimeout method * rename method --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent b9b9e3d commit fd8cf8b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/Illuminate/Process/InvokedProcess.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,22 @@ public function latestErrorOutput()
112112
return $this->process->getIncrementalErrorOutput();
113113
}
114114

115+
/**
116+
* Ensure that the process has not timed out.
117+
*
118+
* @return void
119+
*
120+
* @throws \Illuminate\Process\Exceptions\ProcessTimedOutException
121+
*/
122+
public function ensureNotTimedOut()
123+
{
124+
try {
125+
$this->process->checkTimeout();
126+
} catch (SymfonyTimeoutException $e) {
127+
throw new ProcessTimedOutException($e, new ProcessResult($this->process));
128+
}
129+
}
130+
115131
/**
116132
* Wait for the process to finish.
117133
*

0 commit comments

Comments
 (0)