mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Don't just raise AnsibleError with the exception message (#49654)
* Don't just raise AnsibleError with the exception message. Fixes #49252 * Add changelog fragment
This commit is contained in:
@@ -1030,7 +1030,10 @@ class VaultEditor:
|
||||
with open(filename, "rb") as fh:
|
||||
data = fh.read()
|
||||
except Exception as e:
|
||||
raise AnsibleError(to_native(e))
|
||||
msg = to_native(e)
|
||||
if not msg:
|
||||
msg = repr(e)
|
||||
raise AnsibleError('Unable to read source file (%s): %s' % (to_native(filename), msg))
|
||||
|
||||
return data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user