def strip_quotes(data):
    """
    Strips whitespaces and then quotes (single or double) at both sides of data.
    :param data: string
    :return: dict: 'value': everything inside single or double quotes,
                   'error': empty string if no errors or 'syntax' if quote at the beginning has no matching
                   quote at the end
    """
    result = {'value': '', 'error': 'syntax'}
    data = data.strip()
    if data == '':
        return result
    # Check if single or double quotes are used
    use_double_quotes = False
    data_len = len(data)
    if data_len == 0:
        return result
    if data[0] != "'" and data[0] != '"':
        # no quotes detected, return original data
        result['value'] = data
        result['error'] = ''
        return result
    if data[0] == '"':
        use_double_quotes = True
    if use_double_quotes:
        if data[data_len - 1] != '"':
            return result
    else:
        if data[data_len - 1] != "'":
            return result
    result['value'] = data[1:data_len - 1]
    result['error'] = ''
    return result