'Raises error'

def _writeData(self, config=None):

    if (config is None):
        config = ID3SaveConfig()
    if (config.v2_version == 3):
        frame = self._get_v23_frame(sep=config.v23_separator)
    else:
        frame = self
    data = []
    for writer in self._framespec:
        try:
            data.append(writer.write(config, frame, getattr(frame, writer.name)))
        except SpecError as e:
            raise error(e)
    for writer in self._optionalspec:
        try:
            data.append(writer.write(config, frame, getattr(frame, writer.name)))
        except AttributeError:
            break
        except SpecError as e:
            raise error(e)
    return ''.join(data)
