diff --git a/python/src/com/jetbrains/python/psi/impl/PyBaseElementImpl.java b/python/src/com/jetbrains/python/psi/impl/PyBaseElementImpl.java index b1767d0b2e0c..4bea56bffe8f 100644 --- a/python/src/com/jetbrains/python/psi/impl/PyBaseElementImpl.java +++ b/python/src/com/jetbrains/python/psi/impl/PyBaseElementImpl.java @@ -99,7 +99,7 @@ public class PyBaseElementImpl extends StubBasedPsiElemen protected T childToPsiNotNull(TokenSet filterSet, int index) { final PyElement child = childToPsi(filterSet, index); if (child == null) { - throw new RuntimeException("child must not be null"); + throw new RuntimeException("child must not be null: expression text " + getText()); } //noinspection unchecked return (T)child; @@ -109,7 +109,7 @@ public class PyBaseElementImpl extends StubBasedPsiElemen protected T childToPsiNotNull(IElementType elType) { final PyElement child = childToPsi(elType); if (child == null) { - throw new RuntimeException("child must not be null"); + throw new RuntimeException("child must not be null; expression text " + getText()); } //noinspection unchecked return (T)child;