From 2de692348ffb0f6d7aaa877c4527fc0a26791f99 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Mon, 6 Aug 2018 02:27:55 -0700 Subject: [PATCH] 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. --- docs/docsite/rst/dev_guide/developing_plugins.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docsite/rst/dev_guide/developing_plugins.rst b/docs/docsite/rst/dev_guide/developing_plugins.rst index 1cf407728d..8cdc528be9 100644 --- a/docs/docsite/rst/dev_guide/developing_plugins.rst +++ b/docs/docsite/rst/dev_guide/developing_plugins.rst @@ -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.