Format a VCI error and attach failed function, decoded HRESULT and arguments
        :param CLibrary library_instance:
            Mapped instance of IXXAT vcinpl library
        :param callable function:
            Failed function
        :param HRESULT HRESULT:
            HRESULT returned by vcinpl call
        :param arguments:
            Arbitrary arguments tuple
        :return:
            Formatted string

def __vciFormatErrorExtended(library_instance, function, HRESULT, arguments):
    """ Format a VCI error and attach failed function, decoded HRESULT and arguments
        :param CLibrary library_instance:
            Mapped instance of IXXAT vcinpl library
        :param callable function:
            Failed function
        :param HRESULT HRESULT:
            HRESULT returned by vcinpl call
        :param arguments:
            Arbitrary arguments tuple
        :return:
            Formatted string
    """
    #TODO: make sure we don't generate another exception
    return "{} - arguments were {}".format(
        __vciFormatError(library_instance, function, HRESULT),
        arguments
    )