Process exception during the callback

As process exception may raise an exception, it should be run in the callback
to let the caller catch it. Otherwise it is raised in the thread and never
catch.

issue6907
review42811003
This commit is contained in:
C?dric Krier 2017-11-09 19:03:02 +01:00
parent 413deb4271
commit ba37e1f7bb

View file

@ -1191,17 +1191,15 @@ class RPCProgress(object):
def process(self):
if self.parent and self.parent.get_window():
self.parent.get_window().set_cursor(None)
if self.exception:
if self.process_exception_p:
def rpc_execute(*args):
return RPCProgress('execute',
args).run(self.process_exception_p, self.callback)
return process_exception(self.exception, *self.args,
rpc_execute=rpc_execute)
def return_():
if self.exception:
raise self.exception
if self.process_exception_p:
def rpc_execute(*args):
return RPCProgress('execute',
args).run(self.process_exception_p, self.callback)
return process_exception(self.exception, *self.args,
rpc_execute=rpc_execute)
else:
return self.res