import json


def _parseResult(buffer):
    """
    Parse the string buffer content into a dict using json.loads

    :param buffer: The StringIO buffer to retrieve value

    :return: dict of values
    """
    try:
        # Retrieve output buffer
        output = buffer.getvalue()

        # Turn json string from output into dict
        if output != "":
            return json.loads(output)
        else:
            return json.loads("{}")
    except SystemExit as ex:
        raise BaseException("Error load value from StringIO {}".format(ex))