diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-05-11 11:15:26 -0600 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-05-11 11:15:36 -0600 |
commit | 67a37e6d1f4fd5411e902ee5a59e2085d6c8a12d (patch) | |
tree | a0cb764e4284f585feb29eb52199ca3ff432e885 /mitmproxy/dump.py | |
parent | 4c8e334642d98a5ed005b7cf6fc7e9cc379e6deb (diff) | |
download | mitmproxy-67a37e6d1f4fd5411e902ee5a59e2085d6c8a12d.tar.gz mitmproxy-67a37e6d1f4fd5411e902ee5a59e2085d6c8a12d.tar.bz2 mitmproxy-67a37e6d1f4fd5411e902ee5a59e2085d6c8a12d.zip |
improve script loading
Diffstat (limited to 'mitmproxy/dump.py')
-rw-r--r-- | mitmproxy/dump.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mitmproxy/dump.py b/mitmproxy/dump.py index d224f1aa..0e0ccc62 100644 --- a/mitmproxy/dump.py +++ b/mitmproxy/dump.py @@ -7,7 +7,7 @@ import itertools from netlib import tcp import netlib.utils from . import flow, filt, contentviews -from .exceptions import ContentViewException, FlowReadException +from .exceptions import ContentViewException, FlowReadException, ScriptException class DumpError(Exception): @@ -125,9 +125,10 @@ class DumpMaster(flow.FlowMaster): scripts = options.scripts or [] for command in scripts: - err = self.load_script(command, use_reloader=True) - if err: - raise DumpError(err) + try: + self.load_script(command, use_reloader=True) + except ScriptException as e: + raise DumpError(str(e)) if options.rfile: try: |