1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Use str() to get exception message (#2590) (#2610)

(cherry picked from commit 63012eef82)

Co-authored-by: DasSkelett <dasskelett@gmail.com>
This commit is contained in:
patchback[bot] 2021-05-25 13:59:51 +02:00 committed by GitHub
parent 6dc31b13c3
commit 1ceed02048
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- netcup_dns - use ``str(ex)`` instead of unreliable ``ex.message`` in exception handling to fix ``AttributeError`` in error cases (https://github.com/ansible-collections/community.general/pull/2590).

View file

@ -255,7 +255,7 @@ def main():
has_changed = True has_changed = True
except Exception as ex: except Exception as ex:
module.fail_json(msg=ex.message) module.fail_json(msg=str(ex))
module.exit_json(changed=has_changed, result={"records": [record_data(r) for r in all_records]}) module.exit_json(changed=has_changed, result={"records": [record_data(r) for r in all_records]})