catch StopIteration.value, pass back EventError that comes from a generator
This commit is contained in:
parent
74a4d7077d
commit
3fad17d1b9
1 changed files with 3 additions and 3 deletions
|
@ -174,8 +174,8 @@ class Module(ModuleManager.BaseModule):
|
||||||
try:
|
try:
|
||||||
next_success, next_return = self._hook_call_catch(
|
next_success, next_return = self._hook_call_catch(
|
||||||
lambda: next(hook_return))
|
lambda: next(hook_return))
|
||||||
except StopIteration:
|
except StopIteration as e:
|
||||||
break
|
return True, e.value
|
||||||
|
|
||||||
if next_success:
|
if next_success:
|
||||||
multi_check = None
|
multi_check = None
|
||||||
|
@ -191,7 +191,7 @@ class Module(ModuleManager.BaseModule):
|
||||||
if not check_success:
|
if not check_success:
|
||||||
return False, check_message
|
return False, check_message
|
||||||
else:
|
else:
|
||||||
break
|
return False, next_return
|
||||||
return hook_success, hook_return
|
return hook_success, hook_return
|
||||||
|
|
||||||
def command(self, server, target, target_str, is_channel, user, command,
|
def command(self, server, target, target_str, is_channel, user, command,
|
||||||
|
|
Loading…
Reference in a new issue