Skip to content

Debug Ìmport Config` fault improvement. Add exception details by default. #27

@ja66

Description

@ja66

I ran into some kind of error on my new Laptop which I only can see if I run openvpn3-indocator -d

    def on_config_import(self, name, path):
        logging.info(f'Import Config {name} {path}')
        try:
            parser = openvpn3.ConfigParser(['openvpn3-indicator-config-parser', '--config', path], APPLICATION_TITLE)
            config_description = parser.GenerateConfig()
            import_args = dict()
            if self.manager_version > 20:
                # system_tag arrived in openvpn3-linux v21
                import_args['system_tag'] = APPLICATION_SYSTEM_TAG
            self.config_manager.Import(name, config_description, single_use=False, persistent=True, **import_args)
            self.invalid_sessions = True
        except: #TODO: Catch only expected exceptions
            logging.debug(traceback.format_exc())
            logging.error(f'Failed to import configuration {name} from {path}')

I'd appreciate to see the failure reason.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions