Skip to content
Snippets Groups Projects
Commit c5cf79bf authored by Stefano Borini's avatar Stefano Borini
Browse files

More protections

parent 058d4b23
No related branches found
No related tags found
1 merge request!138More robust logging for BDSS
This commit is part of merge request !138. Comments created here will be created in the context of that merge request.
...@@ -38,8 +38,9 @@ class CoreEvaluationDriver(BaseCoreDriver): ...@@ -38,8 +38,9 @@ class CoreEvaluationDriver(BaseCoreDriver):
"Unable to create communicator from MCO factory '{}' " "Unable to create communicator from MCO factory '{}' "
"in plugin '{}'. This may indicate a programming " "in plugin '{}'. This may indicate a programming "
"error in the plugin".format( "error in the plugin".format(
mco_factory.get_identifier(), mco_factory.id,
mco_factory.plugin.id)) mco_factory.plugin.id))
raise
mco_data_values = _get_data_values_from_mco( mco_data_values = _get_data_values_from_mco(
mco_model, mco_communicator) mco_model, mco_communicator)
...@@ -100,7 +101,7 @@ def _compute_layer_results(environment_data_values, ...@@ -100,7 +101,7 @@ def _compute_layer_results(environment_data_values,
"Unable to create data source from factory '{}' " "Unable to create data source from factory '{}' "
"in plugin '{}'. This may indicate a programming " "in plugin '{}'. This may indicate a programming "
"error in the plugin".format( "error in the plugin".format(
factory.get_identifier(), factory.id,
factory.plugin.id)) factory.plugin.id))
raise raise
......
...@@ -25,7 +25,17 @@ class CoreMCODriver(BaseCoreDriver): ...@@ -25,7 +25,17 @@ class CoreMCODriver(BaseCoreDriver):
@on_trait_change("application:started") @on_trait_change("application:started")
def application_started(self): def application_started(self):
self.mco.run(self.workflow.mco) mco = self.workflow.mco
try:
mco.run(self.workflow.mco)
except Exception:
log.exception(
"Method run() of MCO with id '{}' from plugin '{}' "
"raised exception. This might indicate a "
"programming error in the plugin.".format(
mco.factory.id,
mco.factory.plugin.id))
raise
@on_trait_change("application:stopping") @on_trait_change("application:stopping")
def application_stopping(self): def application_stopping(self):
...@@ -38,7 +48,7 @@ class CoreMCODriver(BaseCoreDriver): ...@@ -38,7 +48,7 @@ class CoreMCODriver(BaseCoreDriver):
workflow = self.workflow workflow = self.workflow
except Exception: except Exception:
log.exception("Unable to open workflow file.") log.exception("Unable to open workflow file.")
sys.exit(1) raise
mco_model = workflow.mco mco_model = workflow.mco
if mco_model is None: if mco_model is None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment