Skip to content

Commit

Permalink
throw exception
Browse files Browse the repository at this point in the history
  • Loading branch information
timkelty committed Nov 24, 2023
1 parent 3b0bab7 commit 5eb0541
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/event/CliHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Exception\ProcessTimedOutException;
use Symfony\Component\Process\Process;
use yii\base\Exception;

class CliHandler implements Handler
{
Expand Down Expand Up @@ -77,9 +78,8 @@ public function getTotalRunningTime(): float
return $this->totalRunningTime;
}

// This doesn't quite make sense, but we're chasing a hunch…
if (!$this->process) {
return 0;
throw new Exception('Process does not exist');
}

return max(0, microtime(true) - $this->process->getStartTime());
Expand Down

0 comments on commit 5eb0541

Please sign in to comment.