If the response contains errors in run() then raise a RuntimeError, otherwise return the output instead of the Response object

This commit is contained in:
Fabio Manganiello 2020-04-10 00:06:36 +02:00
parent 7b79e4b669
commit 0cd28f7499
1 changed files with 6 additions and 1 deletions

View File

@ -295,7 +295,12 @@ def run(action, *args, **kwargs):
(module_name, method_name) = get_module_and_method_from_action(action)
plugin = get_plugin(module_name)
method = getattr(plugin, method_name)
return method(*args, **kwargs)
response = method(*args, **kwargs)
if response.errors:
raise RuntimeError(response.errors[0])
return response.output
# vim:sw=4:ts=4:et: