mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-04-24 04:14:57 +08:00
Better response when mitmproxy crashes.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import mailcap, mimetypes, tempfile, os, subprocess, glob, time, shlex, stat
|
||||
import os.path, sys, weakref
|
||||
import os.path, sys, weakref, traceback
|
||||
import urwid
|
||||
from .. import controller, utils, flow, script
|
||||
import flowlist, flowview, help, common, grideditor, palettes, contentview, flowdetailview
|
||||
@@ -591,7 +591,12 @@ class ConsoleMaster(flow.FlowMaster):
|
||||
print >> sys.stderr, "Could not load file:", ret
|
||||
sys.exit(1)
|
||||
|
||||
self.ui.run_wrapper(self.loop)
|
||||
try:
|
||||
self.ui.run_wrapper(self.loop)
|
||||
except Exception:
|
||||
print >> sys.stderr, traceback.format_exc()
|
||||
print >> sys.stderr, "mitmproxy has crashed!"
|
||||
print >> sys.stderr, "Please lodge a bug report at: https://github.com/mitmproxy/mitmproxy"
|
||||
# If True, quit just pops out to flow list view.
|
||||
print >> sys.stderr, "Shutting down..."
|
||||
sys.stderr.flush()
|
||||
|
||||
@@ -1043,4 +1043,4 @@ class HTTPHandler(ProtocolHandler, TemporaryServerChangeMixin):
|
||||
self.c.config.authenticator.clean(request.headers)
|
||||
else:
|
||||
raise HttpAuthenticationError(self.c.config.authenticator.auth_challenge_headers())
|
||||
return request.headers
|
||||
return request.headers
|
||||
|
||||
Reference in New Issue
Block a user