From 1ddb9433148e7a5456f1b62afbf9561d9d831c74 Mon Sep 17 00:00:00 2001 From: lexxorlov Date: Sat, 30 Nov 2019 19:27:02 +0200 Subject: [PATCH] Add job exception --- Exception/JobNotFoundException.php | 27 +++++++++++++++++++++++++++ Service/JobResolver.php | 4 ++-- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 Exception/JobNotFoundException.php 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."); } /**