import pickle


def loads(value):
    """Unpickles value, raises a ValueError in case anything fails."""
    try:
        obj = pickle.loads(value)
    except Exception as e:
        raise ValueError('Cannot unpickle value', e)
    return obj