diff options
author | Samoilenko Roman <ttahabatt@gmail.com> | 2018-01-14 22:54:43 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2018-01-14 21:54:43 +0100 |
commit | 2d07678fe5e7b3001462cbc15ff1fd5042259532 (patch) | |
tree | e222d9a02a59a318810504e95ef96d97af8bdb30 | |
parent | 6b22da6a34f9ab4809bac5d2c940a23e165012ee (diff) | |
download | mitmproxy-2d07678fe5e7b3001462cbc15ff1fd5042259532.tar.gz mitmproxy-2d07678fe5e7b3001462cbc15ff1fd5042259532.tar.bz2 mitmproxy-2d07678fe5e7b3001462cbc15ff1fd5042259532.zip |
Fix #2765 (#2792)
-rw-r--r-- | mitmproxy/addons/view.py | 3 | ||||
-rw-r--r-- | test/mitmproxy/addons/test_view.py | 4 |
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(): |