summaryrefslogtreecommitdiff
path: root/lib/ansible/errors
diff options
context:
space:
mode:
authorBrian Coca <bcoca@users.noreply.github.com>2020-07-10 18:49:57 -0400
committerGitHub <noreply@github.com>2020-07-10 18:49:57 -0400
commitcf89ca8a03a8a84302ad27cb1fc7aa9120b743ca (patch)
tree5664afe655648eb955ef42cecb15b9df5909247d /lib/ansible/errors
parent24dcaf8974f27bb16577975cf46a36334f37784b (diff)
downloadansible-cf89ca8a03a8a84302ad27cb1fc7aa9120b743ca.tar.gz
Make filter type errors 'loop friendly' (#70417)
- ensure we preserve the typeerror part of the exception so loop defereed error handling can postpone those caused by undefined variables until the when check is done. - fix tests to comply with the 'new normal' - human_to_bytes and others can issue TypeError not only on 'non string' but also bad string that is not convertable. Co-authored-by: Sloane Hertel <shertel@redhat.com> Co-authored-by: Sloane Hertel <shertel@redhat.com>
Diffstat (limited to 'lib/ansible/errors')
-rw-r--r--lib/ansible/errors/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ansible/errors/__init__.py b/lib/ansible/errors/__init__.py
index 79d9c5f4c3..563c5d2549 100644
--- a/lib/ansible/errors/__init__.py
+++ b/lib/ansible/errors/__init__.py
@@ -334,3 +334,8 @@ class AnsiblePluginCircularRedirect(AnsiblePluginError):
class AnsibleCollectionUnsupportedVersionError(AnsiblePluginError):
'''a collection is not supported by this version of Ansible'''
pass
+
+
+class AnsibleFilterTypeError(AnsibleTemplateError, TypeError):
+ ''' a Jinja filter templating failure due to bad type'''
+ pass