public static function fromInstantiationException($class, Exception $exception)
    {
        $message = sprintf(
            'Could not instantiate OptionRepository of type "%1$s". Reason: %2$s',
            is_object($class)
                ? get_class($class)
                : gettype($class),
            $exception->getMessage()
        );

        return new static($message, 0, $exception);
    }