mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
also captures typeerrors for when not getting a proper string in output
This commit is contained in:
parent
8ace659d4c
commit
0858d97c44
1 changed files with 1 additions and 1 deletions
|
@ -295,7 +295,7 @@ class TaskExecutor:
|
||||||
# response, so we parse it here and replace the result
|
# response, so we parse it here and replace the result
|
||||||
try:
|
try:
|
||||||
result = json.loads(result.get('stdout'))
|
result = json.loads(result.get('stdout'))
|
||||||
except ValueError, e:
|
except (TypeError, ValueError) as e:
|
||||||
return dict(failed=True, msg="The async task did not return valid JSON: %s" % str(e))
|
return dict(failed=True, msg="The async task did not return valid JSON: %s" % str(e))
|
||||||
|
|
||||||
if self._task.poll > 0:
|
if self._task.poll > 0:
|
||||||
|
|
Loading…
Reference in a new issue