diff --git a/Exception/JobNotFoundException.php b/Exception/JobNotFoundException.php new file mode 100644 index 0000000..388cdf7 --- /dev/null +++ b/Exception/JobNotFoundException.php @@ -0,0 +1,27 @@ + + * + * @package SfCod\QueueBundle\Exception + */ +class JobNotFoundException extends InvalidArgumentException +{ + /** + * Create a new exception instance. + * + * @param string $message + * + * @return void + */ + public function __construct($message) + { + parent::__construct($message); + } +} diff --git a/Service/JobResolver.php b/Service/JobResolver.php index 63f387e..10f4bcc 100644 --- a/Service/JobResolver.php +++ b/Service/JobResolver.php @@ -4,7 +4,7 @@ use SfCod\QueueBundle\Base\JobInterface; use SfCod\QueueBundle\Base\JobResolverInterface; -use SfCod\QueueBundle\Exception\FatalThrowableException; +use SfCod\QueueBundle\Exception\JobNotFoundException; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -34,7 +34,7 @@ public function resolve(string $id): JobInterface return $this->jobs[$id]; } - throw new FatalThrowableException("Job handler '$id' not found."); + throw new JobNotFoundException("Job handler '$id' not found."); } /**