mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-04-29 20:55:03 +08:00
Add some error handling for connection saving.
This commit is contained in:
@@ -266,11 +266,14 @@ class ConnectionView(urwid.WidgetWrap):
|
|||||||
else:
|
else:
|
||||||
c = self.flow.response
|
c = self.flow.response
|
||||||
path = os.path.expanduser(path)
|
path = os.path.expanduser(path)
|
||||||
f = file(path, "w")
|
try:
|
||||||
f.write(str(c.headers))
|
f = file(path, "w")
|
||||||
f.write("\r\n")
|
f.write(str(c.headers))
|
||||||
f.write(str(c.content))
|
f.write("\r\n")
|
||||||
f.close()
|
f.write(str(c.content))
|
||||||
|
f.close()
|
||||||
|
except IOError, v:
|
||||||
|
self.master.statusbar.message(str(v))
|
||||||
|
|
||||||
def edit(self, part):
|
def edit(self, part):
|
||||||
if self.viewing == self.REQ:
|
if self.viewing == self.REQ:
|
||||||
|
|||||||
Reference in New Issue
Block a user