summaryrefslogtreecommitdiff
path: root/grc/core/platform.py
diff options
context:
space:
mode:
authorGrant Cox <grant.cox@deepspaceamps.com>2019-12-14 16:55:57 -0600
committerMarcus Müller <marcus@hostalia.de>2019-12-19 18:50:58 +0100
commit3918935810ffdede5bc564ee0854f9cc6293289f (patch)
tree1221377581f3b5a93625d199f2b4aa0af7fc64c9 /grc/core/platform.py
parentb6e36158da979a4b016d3b0cb89de5f74f764e3e (diff)
grc: report flowgraph loading errors nicely in grcc
Wrote function in Platform to use get_error_messages() member function from parent class and report these upon a flowgraph loading exception.
Diffstat (limited to 'grc/core/platform.py')
-rw-r--r--grc/core/platform.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/grc/core/platform.py b/grc/core/platform.py
index 46a795bd0b..e62ebebef2 100644
--- a/grc/core/platform.py
+++ b/grc/core/platform.py
@@ -110,6 +110,7 @@ class Platform(Element):
raise Exception('Not a hier block')
except Exception as e:
Messages.send('>>> Load Error: {}: {}\n'.format(file_path, str(e)))
+ self._flowgraph_error_report(flow_graph)
return None, None
finally:
self._auto_hier_block_generate_chain.discard(file_path)
@@ -392,6 +393,19 @@ class Platform(Element):
return [(value, name, value == output_language_default)
for value, name in zip(param['options'], param['option_labels'])]
+ def _flowgraph_error_report(self, flowgraph):
+ """ verbose error report upon loading exception """
+ error_list = flowgraph.get_error_messages()
+ if not error_list:
+ return
+
+ Messages.send('*' * 50 + '\n')
+ summary_msg = '{} errors from flowgraph:\n'.format(len(error_list))
+ Messages.send(summary_msg)
+ for err in error_list:
+ Messages.send(err)
+ Messages.send('\n' + '*' * 50 + '\n')
+
##############################################
# Factories
##############################################