Gracefully handle invalid data format passed to -r flag.
This commit is contained in:
parent
d3dce8f943
commit
46bd780862
|
@ -640,7 +640,10 @@ class ConsoleMaster(flow.FlowMaster):
|
|||
fr = flow.FlowReader(f)
|
||||
except IOError, v:
|
||||
return v.strerror
|
||||
flow.FlowMaster.load_flows(self, fr)
|
||||
try:
|
||||
flow.FlowMaster.load_flows(self, fr)
|
||||
except flow.FlowReadError, v:
|
||||
return v.strerror
|
||||
f.close()
|
||||
if self.conn_list_view:
|
||||
self.sync_list_view()
|
||||
|
|
|
@ -103,7 +103,10 @@ class DumpMaster(flow.FlowMaster):
|
|||
freader = flow.FlowReader(f)
|
||||
except IOError, v:
|
||||
raise DumpError(v.strerror)
|
||||
self.load_flows(freader)
|
||||
try:
|
||||
self.load_flows(freader)
|
||||
except flow.FlowReadError, v:
|
||||
raise DumpError(v)
|
||||
|
||||
|
||||
def _readflow(self, path):
|
||||
|
|
Loading…
Reference in New Issue