diff --git a/libmproxy/console/__init__.py b/libmproxy/console/__init__.py index 608742a40..76968ae5b 100644 --- a/libmproxy/console/__init__.py +++ b/libmproxy/console/__init__.py @@ -640,7 +640,10 @@ class ConsoleMaster(flow.FlowMaster): fr = flow.FlowReader(f) except IOError, v: return v.strerror - flow.FlowMaster.load_flows(self, fr) + try: + flow.FlowMaster.load_flows(self, fr) + except flow.FlowReadError, v: + return v.strerror f.close() if self.conn_list_view: self.sync_list_view() diff --git a/libmproxy/dump.py b/libmproxy/dump.py index 2ad88cfcc..d71aed42b 100644 --- a/libmproxy/dump.py +++ b/libmproxy/dump.py @@ -103,7 +103,10 @@ class DumpMaster(flow.FlowMaster): freader = flow.FlowReader(f) except IOError, v: raise DumpError(v.strerror) - self.load_flows(freader) + try: + self.load_flows(freader) + except flow.FlowReadError, v: + raise DumpError(v) def _readflow(self, path):