use Foundation\Guard\Exceptions\CouldNotResolveStringException;
15
use Symfony\Component\HttpFoundation\File\Exception\UnexpectedTypeException;
16
17
class ExceptionResolver extends Resolver
18
{
19
protected $exception;
20
21
/**
22
* GuardsResolver constructor.
23
* @param $exception
24
*/
25
1
public function __construct($exception)
26
{
27
1
$this->exception = $exception;
28
1
}
29
30
1
public function resolve()
31
{
32
1
if (is_string($this->exception) || !($this->exception instanceof \Throwable)) {
33
try {
34
1
$exception = new $this->exception;
35
} catch (\Exception $e) {
36
throw new CouldNotResolveStringException("Could not resolve the string to an exception. It probably requires additional arguments. try to pass it as an object to the dispatcher");