Use str() to get exception message (#2590)
parent
593d622438
commit
63012eef82
|
@ -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).
|
|
@ -255,7 +255,7 @@ def main():
|
|||
has_changed = True
|
||||
|
||||
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]})
|
||||
|
||||
|
|
Loading…
Reference in New Issue