public function setExceptionType(string $exceptionType): self
    {
        try {
            $ref = new \ReflectionClass($exceptionType);
            if (!$ref->implementsInterface(\Throwable::class)) {
                throw new \InvalidArgumentException('Exception class must implement Throwable interface');
            }
        } catch (\ReflectionException $e) {
            throw new \InvalidArgumentException('Exception class not found');
        }

        $this->exceptionType = $exceptionType;
        return $this;
    }
public function setExceptionType(string $exceptionType): self
    {
        try {
            $ref = new \ReflectionClass($exceptionType);
            if (!$ref->implementsInterface(\Throwable::class)) {
                throw new \InvalidArgumentException('Exception class must implement Throwable interface');
            }
        } catch (\ReflectionException $e) {
            throw new \InvalidArgumentException('Exception class not found');
        }

        $this->exceptionType = $exceptionType;
        return $this;
    }
public function setExceptionType ( string $ exceptionType ) : self { try { $ ref = new \ ReflectionClass ( $ exceptionType ) ; if ( ! $ ref -> implementsInterface ( \ Throwable :: class ) ) { throw new \ InvalidArgumentException ( 'Exception class must implement Throwable interface' ) ; } } catch ( \ ReflectionException $ e ) { throw new \ InvalidArgumentException ( 'Exception class not found' ) ; } $ this -> exceptionType = $ exceptionType ; return $ this ; }
Sets the exception class name which should be catched during tries.

@param string $exceptionType

@return self
Sets the exception class name which should be catched during tries .