Skip to content

Commit

Permalink
better exception message
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid committed Feb 7, 2020
1 parent 2b1738a commit 7d1f571
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Queue/VaporWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public function runVaporJob($job, $connectionName, WorkerOptions $options)
{
pcntl_async_signals(true);

pcntl_signal(SIGALRM, function (){
throw new VaporJobTimedOutException();
pcntl_signal(SIGALRM, function () use ($job) {
throw new VaporJobTimedOutException($job->resolveName());
});

pcntl_alarm(
Expand Down
5 changes: 3 additions & 2 deletions src/VaporJobTimedOutException.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ class VaporJobTimedOutException extends Exception
/**
* Create a new exception instance.
*
* @param string $name
* @param Throwable|null $previous
*/
public function __construct(Throwable $previous = null)
public function __construct($name, Throwable $previous = null)
{
parent::__construct("A queued job has timed out. It will be retried again.", 0, $previous);
parent::__construct($name. ' has timed out. It will be retried again.', 0, $previous);
}
}

0 comments on commit 7d1f571

Please sign in to comment.