Skip to content

Commit

Permalink
Add job exception
Browse files Browse the repository at this point in the history
  • Loading branch information
lexxorlov committed Nov 30, 2019
1 parent 0806c6a commit 1ddb943
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
27 changes: 27 additions & 0 deletions Exception/JobNotFoundException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace SfCod\QueueBundle\Exception;

use InvalidArgumentException;

/**
* Class InvalidPayloadException
*
* @author Orlov Alexey <aaorlov88@gmail.com>
*
* @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);
}
}
4 changes: 2 additions & 2 deletions Service/JobResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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.");
}

/**
Expand Down

0 comments on commit 1ddb943

Please sign in to comment.