import json


def deserialize(data):
    """Deserialize json string.

    :raises ValueError: raise ValueError when can't load json

    :param data: json string
    :type data: str

    :return: dict object
    :rtype: dict
    """
    try:
        return json.loads(data)
    except (json.JSONDecodeError, TypeError):
        raise ValueError("Deserialize failed. Invalid data.")