[re2o_lookup] Ansible way to manage errors.

certbot_on_virtu
_pollion 2020-04-25 23:14:33 +02:00
parent 15cf56ba65
commit ce87098727
1 changed files with 7 additions and 1 deletions

View File

@ -413,7 +413,13 @@ class LookupModule(LookupBase):
if term == 'dnszones':
res.append(self._getzones(api_client))
else:
try:
res.append(self._rawquery(api_client, term))
except Exception as e:
raise AnsibleError("""
An error occured while running re2oapi
lookup plugin. Original message was : {}"""
.format(to_native(e)))
return res
def _getzones(self, api_client):