def METHOD_NAME(self, pkg, filename, e):
    """
    Determine what to do with a caught configparser error.
    """
    # I would love to use switch, however, each warning is printed differently
    if (isinstance(e, cfgparser.MissingSectionHeaderError)):
        self.output.add_info('E', pkg, 'desktopfile-missing-header', filename)
    elif (isinstance(e, cfgparser.DuplicateSectionError)):
        self.output.add_info('E', pkg, 'desktopfile-duplicate-section', filename,
                             '[{e.section}]')
    elif (isinstance(e, cfgparser.DuplicateOptionError)):
        self.output.add_info('E', pkg, 'desktopfile-duplicate-option', filename,
                             '[{e.section}]/{e.option}')
    else:
        self.output.add_info('E', pkg, 'invalid-desktopfile', filename,
                             e.message.partition(':')[0])