summaryrefslogtreecommitdiff
path: root/astroid/exceptions.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2016-12-03 14:45:56 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2016-12-03 14:45:56 +0200
commiteb9642ffeeab679b952e785be88916a450d317f7 (patch)
tree1d4f51deb400141c029fbc3915ac0944832b3df8 /astroid/exceptions.py
parentac3e82e9bd8678086325a71a927a06bbc43d415e (diff)
downloadastroid-git-eb9642ffeeab679b952e785be88916a450d317f7.tar.gz
Let the type error propagate as an AstroidTypeError.
Diffstat (limited to 'astroid/exceptions.py')
-rw-r--r--astroid/exceptions.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/astroid/exceptions.py b/astroid/exceptions.py
index ea2b9b07..8b3f2522 100644
--- a/astroid/exceptions.py
+++ b/astroid/exceptions.py
@@ -196,6 +196,14 @@ class _NonDeducibleTypeHierarchy(Exception):
"""Raised when is_subtype / is_supertype can't deduce the relation between two types."""
+class AstroidIndexError(AstroidError):
+ """Raised when an Indexable / Mapping does not have an index / key."""
+
+
+class AstroidTypeError(AstroidError):
+ """Raised when a TypeError would be expected in Python code."""
+
+
# Backwards-compatibility aliases
OperationError = util.BadOperationMessage
UnaryOperationError = util.BadUnaryOperationMessage