aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mitmproxy/addons/view.py3
-rw-r--r--test/mitmproxy/addons/test_view.py4
2 files changed, 6 insertions, 1 deletions
diff --git a/mitmproxy/addons/view.py b/mitmproxy/addons/view.py
index c3fb4b88..e87daf35 100644
--- a/mitmproxy/addons/view.py
+++ b/mitmproxy/addons/view.py
@@ -365,7 +365,8 @@ class View(collections.Sequence):
self.add([i.copy()])
except IOError as e:
ctx.log.error(e.strerror)
- return
+ except exceptions.FlowReadException as e:
+ ctx.log.error(str(e))
@command.command("view.go")
def go(self, dst: int) -> None:
diff --git a/test/mitmproxy/addons/test_view.py b/test/mitmproxy/addons/test_view.py
index a95d059d..6f2a9ca5 100644
--- a/test/mitmproxy/addons/test_view.py
+++ b/test/mitmproxy/addons/test_view.py
@@ -179,6 +179,10 @@ def test_load(tmpdir):
v.load_file("nonexistent_file_path")
except IOError:
assert False
+ with open(path, "wb") as f:
+ f.write(b"invalidflows")
+ v.load_file(path)
+ assert tctx.master.has_log("Invalid data format.")
def test_resolve():