diff options
author | Arpit Gupta <guptarpit1997@gmail.com> | 2019-03-19 02:24:07 +0530 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-06-18 22:33:28 -0700 |
commit | 9fec5882536985d8d5f3065896efe035df5ae562 (patch) | |
tree | a8ed8998beea0d10728c8879c6903158df061eb3 | |
parent | 45d3edc11f681e1d6403911a2eb814a139f0436b (diff) |
GRC: Fix for GRC crash in case of flowgraph error
-rw-r--r-- | grc/core/Messages.py | 4 | ||||
-rw-r--r-- | grc/core/platform.py | 3 | ||||
-rw-r--r-- | grc/gui/MainWindow.py | 7 |
3 files changed, 14 insertions, 0 deletions
diff --git a/grc/core/Messages.py b/grc/core/Messages.py index f546c3b62e..2a597d367c 100644 --- a/grc/core/Messages.py +++ b/grc/core/Messages.py @@ -25,6 +25,10 @@ import sys MESSENGERS_LIST = list() _indent = '' +# Global FlowGraph Error and the file that caused it +global flowgraph_error +global flowgraph_error_file + def register_messenger(messenger): """ diff --git a/grc/core/platform.py b/grc/core/platform.py index 46b0af6f74..62795a12cf 100644 --- a/grc/core/platform.py +++ b/grc/core/platform.py @@ -177,6 +177,9 @@ class Platform(Element): except Exception as error: logger.exception('Error while loading %s', file_path) logger.exception(error) + Messages.flowgraph_error = error + Messages.flowgraph_error_file = file_path + continue for key, block in six.iteritems(self.blocks): category = self._block_categories.get(key, block.category) diff --git a/grc/gui/MainWindow.py b/grc/gui/MainWindow.py index e737610a79..7d0337856e 100644 --- a/grc/gui/MainWindow.py +++ b/grc/gui/MainWindow.py @@ -260,6 +260,13 @@ class MainWindow(Gtk.ApplicationWindow): flow_graph=flow_graph, file_path=file_path, ) + if str(Messages.flowgraph_error) is not None: + Messages.send( + ">>> Check: {}\n>>> FlowGraph Error: {}\n".format( + str(Messages.flowgraph_error_file), + str(Messages.flowgraph_error) + ) + ) if file_path: Messages.send_end_load() except Exception as e: #return on failure Messages.send_fail_load(e) |