mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
change raising errors example to raise error (#43664)
Example instantiates an AnsibleError which derives from Exception but doesn't actually raise it like intended. This is misleading as it's not clear without examining the code for AnsibleError to know that it's not some function which would raise the exception automatically.
This commit is contained in:
parent
741fa025a0
commit
2de692348f
1 changed files with 1 additions and 1 deletions
|
@ -26,7 +26,7 @@ In general, errors encountered during execution should be returned by raising An
|
|||
try:
|
||||
cause_an_exception()
|
||||
except Exception as e:
|
||||
AnsibleError('Something happened, this was original exception: %s' % to_native(e))
|
||||
raise AnsibleError('Something happened, this was original exception: %s' % to_native(e))
|
||||
|
||||
Check the different AnsibleError objects and see which one applies the best to your situation.
|
||||
|
||||
|
|
Loading…
Reference in a new issue