Phive\Queue\ExceptionalQueue::exceptional PHP Method

exceptional() protected method

protected exceptional ( Closure $func ) : mixed
$func Closure The function to execute.
return mixed
    protected function exceptional(\Closure $func)
    {
        try {
            $result = $func();
        } catch (QueueException $e) {
            throw $e;
        } catch (\Exception $e) {
            throw new QueueException($this->queue, $e->getMessage(), 0, $e);
        }
        return $result;
    }