comparison src/core/sat_main.py @ 2262:24f5a4d5f195

core: check uncatched exceptions during plugin import and stdui init, log error and exit if any found
author Goffi <goffi@goffi.org>
date Wed, 21 Jun 2017 19:40:13 +0200
parents 83bcd9ec4782
children 8b37a62336c3
comparison
equal deleted inserted replaced
2261:8be4f5769bf7 2262:24f5a4d5f195
145 return os.path.splitext(os.path.basename(self.bridge.__file__))[0] 145 return os.path.splitext(os.path.basename(self.bridge.__file__))[0]
146 146
147 def _postMemoryInit(self, ignore): 147 def _postMemoryInit(self, ignore):
148 """Method called after memory initialization is done""" 148 """Method called after memory initialization is done"""
149 log.info(_("Memory initialised")) 149 log.info(_("Memory initialised"))
150 self._import_plugins() 150 try:
151 ui_contact_list.ContactList(self) 151 self._import_plugins()
152 ui_profile_manager.ProfileManager(self) 152 ui_contact_list.ContactList(self)
153 ui_profile_manager.ProfileManager(self)
154 except Exception as e:
155 log.error(_(u"Could not initialize backend: {reason}").format(
156 reason = str(e).decode('utf-8', 'ignore')))
157 sys.exit(1)
153 self.initialised.callback(None) 158 self.initialised.callback(None)
154 log.info(_(u"Backend is ready")) 159 log.info(_(u"Backend is ready"))
155 160
156 def _unimport_plugin(self, plugin_path): 161 def _unimport_plugin(self, plugin_path):
157 """remove a plugin from sys.modules if it is there""" 162 """remove a plugin from sys.modules if it is there"""