Skip to content

Commit

Permalink
catching wider range of errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Ondřej Tölg committed Jul 29, 2021
1 parent 7438aa2 commit 51c5fa3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Cronner/Cronner.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
use stekycz\Cronner\Exceptions\RuntimeException;
use stekycz\Cronner\Tasks\Parameters;
use stekycz\Cronner\Tasks\Task;
use Throwable;
use Tracy\Debugger;

/**
* @method void onTaskBegin(Cronner $cronner, Task $task)
* @method void onTaskFinished(Cronner $cronner, Task $task)
* @method void onTaskError(Cronner $cronner, Exception $exception, Task $task)
* @method void onTaskError(Cronner $cronner, Throwable $exception, Task $task)
*/
class Cronner
{
Expand Down Expand Up @@ -225,7 +226,7 @@ public function run(DateTimeInterface $now = NULL)
$this->criticalSection->leave($name);
}
}
} catch (Exception $e) {
} catch (Throwable $e) {
$this->onTaskError($this, $e, $task);
$name = $task->getName();
if ($this->criticalSection->isEntered($name)) {
Expand Down

0 comments on commit 51c5fa3

Please sign in to comment.