diff --git a/force_bdss/core_mco_driver.py b/force_bdss/core_mco_driver.py index a75f1aaef9ea8b3589d9e1187bd472d1e62dccfc..fb940f70c9a1fd227c8374d732be0ef25e1138e7 100644 --- a/force_bdss/core_mco_driver.py +++ b/force_bdss/core_mco_driver.py @@ -25,7 +25,14 @@ class CoreMCODriver(BaseCoreDriver): @on_trait_change("application:started") def application_started(self): - mco = self.workflow.mco + try: + mco = self.mco + except Exception: + log.exception( + "Unable to obtain MCO with id '{}' from plugin '{}'." + ) + sys.exit(1) + try: mco.run(self.workflow.mco) except Exception: @@ -35,7 +42,7 @@ class CoreMCODriver(BaseCoreDriver): "programming error in the plugin.".format( mco.factory.id, mco.factory.plugin.id)) - raise + sys.exit(1) @on_trait_change("application:stopping") def application_stopping(self): diff --git a/force_bdss/tests/test_core_mco_driver.py b/force_bdss/tests/test_core_mco_driver.py index 407244e3fdedf9c002fa88ab43a52c0e54988002..0c8fcbf7570371566a0a8ef29b1ddddd911a5c01 100644 --- a/force_bdss/tests/test_core_mco_driver.py +++ b/force_bdss/tests/test_core_mco_driver.py @@ -116,7 +116,7 @@ class TestCoreMCODriver(unittest.TestCase): "'force.bdss.enthought.plugin.test.v0" ".factory.probe_notification_listener' in plugin " "'force.bdss.enthought.plugin.test.v0'. The listener will " - "be dropped and computation will continue." )) + "be dropped and computation will continue.")) def test_finalize_error(self): driver = CoreMCODriver(